git://git.nikiroo.be
/
jvcard.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix PREF handling (was not correct relative to the RFC!)
[jvcard.git]
/
src
/
be
/
nikiroo
/
jvcard
/
launcher
/
Main.java
diff --git
a/src/be/nikiroo/jvcard/launcher/Main.java
b/src/be/nikiroo/jvcard/launcher/Main.java
index 080223d07251b8b54e561c5b917e2dbe477def19..f193be1b493ae81c09178c1f446ca5563f4ce917 100644
(file)
--- a/
src/be/nikiroo/jvcard/launcher/Main.java
+++ b/
src/be/nikiroo/jvcard/launcher/Main.java
@@
-63,7
+63,7
@@
public class Main {
* @return the translated text with the given value where required
*/
static public String trans(StringId id, Object... values) {
* @return the translated text with the given value where required
*/
static public String trans(StringId id, Object... values) {
- return transService.getString(id,
(Object[])
values);
+ return transService.getString(id, values);
}
/**
}
/**
@@
-278,6
+278,7
@@
public class Main {
new RemoteBundle().updateFile(dir);
} catch (IOException e) {
e.printStackTrace();
new RemoteBundle().updateFile(dir);
} catch (IOException e) {
e.printStackTrace();
+ System.err.flush();
System.exit(ERR_INTERNAL);
}
break;
System.exit(ERR_INTERNAL);
}
break;
@@
-318,8
+319,15
@@
public class Main {
if (f.exists()) {
System.out.println("Loading " + f);
try {
if (f.exists()) {
System.out.println("Loading " + f);
try {
- String b64 = StringUtils.fromImage(ImageIO
- .read(f));
+ String type = "jpeg";
+ int dotIndex = filename.indexOf('.');
+ if (dotIndex >= 0
+ && (dotIndex + 1) < filename.length()) {
+ type = filename.substring(dotIndex + 1)
+ .toLowerCase();
+ }
+
+ String b64 = StringUtils.fromImage(f);
// remove previous photos:
for (Data photo = contact
// remove previous photos:
for (Data photo = contact
@@
-331,7
+339,7
@@
public class Main {
List<TypeInfo> types = new LinkedList<TypeInfo>();
types.add(new TypeInfo("ENCODING", "b"));
List<TypeInfo> types = new LinkedList<TypeInfo>();
types.add(new TypeInfo("ENCODING", "b"));
- types.add(new TypeInfo("TYPE",
"png"
));
+ types.add(new TypeInfo("TYPE",
type
));
Data photo = new Data(types, "PHOTO", b64, null);
contact.add(photo);
} catch (IOException e) {
Data photo = new Data(types, "PHOTO", b64, null);
contact.add(photo);
} catch (IOException e) {
@@
-421,7
+429,7
@@
public class Main {
+ trans(StringId.CLI_HELP_LANG));
System.out.println("\t--tui : " + trans(StringId.CLI_HELP_TUI));
System.out.println("\t--gui : " + trans(StringId.CLI_HELP_GUI));
+ trans(StringId.CLI_HELP_LANG));
System.out.println("\t--tui : " + trans(StringId.CLI_HELP_TUI));
System.out.println("\t--gui : " + trans(StringId.CLI_HELP_GUI));
- System.out.println("\t--noutf : " + trans(StringId.CLI_HELP_NOUTF));
+ System.out.println("\t--noutf : " + trans(StringId.CLI_HELP_NOUTF
_OPTION
));
System.out.println("\t--config : "
+ trans(StringId.CLI_HELP_CONFIG));
System.out.println();
System.out.println("\t--config : "
+ trans(StringId.CLI_HELP_CONFIG));
System.out.println();
@@
-632,6
+640,7
@@
public class Main {
else
System.err.println(trans(err, trans(suberr, subvalues)));
else
System.err.println(trans(err, trans(suberr, subvalues)));
+ System.err.flush();
System.exit(CODE);
}
}
System.exit(CODE);
}
}