1
0
Fork 0
mirror of https://github.com/vanitasvitae/Spherical synced 2024-12-22 02:48:00 +01:00
This commit is contained in:
vanitasvitae 2017-09-15 00:55:43 +02:00
parent 94c7d8c540
commit a497955836
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 21 additions and 6 deletions

View file

@ -169,32 +169,45 @@ public class PhotoSphereParser {
private static Integer parseInteger(String key, String xmp, Integer defaultValue) {
String value = parseString(key, xmp);
return value == null ? defaultValue : Integer.parseInt(value);
if (value == null) {
return defaultValue;
}
return Integer.parseInt(value);
}
private static Float parseFloat(String key, String xmp, Float defaultValue) {
String value = parseString(key, xmp);
if (value == null) {
return defaultValue;
} else {
return Float.parseFloat(value);
}
return Float.parseFloat(value);
}
private static Boolean parseBoolean(String key, String xmp, Boolean defaultValue) {
String value = parseString(key, xmp);
return value == null ? defaultValue : Boolean.parseBoolean(value);
if (value == null) {
return defaultValue;
}
return Boolean.parseBoolean(value);
}
private static ProjectionType parseType(String key, String xmp, ProjectionType defaultValue) {
String value = parseString(key, xmp);
return value == null ? defaultValue : ProjectionType.equirectangular;
if (value == null) {
return defaultValue;
}
return ProjectionType.equirectangular;
}
private static Date parseDate(String key, String xmp, Date defaultValue) {
String value = parseString(key, xmp);
try {
return value == null ? defaultValue : dateFormat.parse(value);
if (value == null) {
return defaultValue;
}
return dateFormat.parse(value);
} catch (ParseException e) {
return defaultValue;
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>