Reference sourceRef = state.getTransactionalSourceReference();\r
URI uri;\r
URI thumbUri;\r
- ImageInfo imageInfo = null;\r
- ImageInfo thumbImageInfo = null;\r
- if (!state.getConfig().isSalvador()){\r
+ if (state.getConfig().isSalvador()){\r
String thumbs = "thumbs/";\r
String uriStr = "http://media.e-taxonomy.eu/salvador/berendsohn-et-al-%s/%s.jpg";\r
Integer intFact = Integer.valueOf(fact);\r
int page = intFact + 249;\r
if (intFact >= 263){\r
vol = "2016";\r
+ page = intFact + (intFact < 403 ? 95 : 96);\r
}else if (intFact >= 142){\r
vol = "2012";\r
page = intFact + (intFact < 255 ? 3 : 4);\r
}\r
+ media.putTitle(Language.SPANISH_CASTILIAN(), fact);\r
Reference ref = getSalvadorReference(vol);\r
media.addSource(OriginalSourceType.PrimaryMediaSource, "Fig. " + fact, null, ref, String.valueOf(page));\r
media.setArtist(getSalvadorArtist());\r
String thumbUriStr = String.format(uriStr, vol, thumbs + fact);\r
uri = new URI(uriStr);\r
thumbUri = new URI(thumbUriStr);\r
- if (!state.getConfig().isSalvador()){\r
- try {\r
- imageInfo = ImageInfo.NewInstance(uri, 0);\r
- } catch (IOException | HttpException e) {\r
- logger.error("Error when reading image meta: " + e);\r
- }\r
- try {\r
- thumbImageInfo = ImageInfo.NewInstance(thumbUri, 0);\r
- } catch (IOException | HttpException e) {\r
- logger.error("Error when reading image meta: " + e);\r
- }\r
- }\r
}else{\r
uri = new URI(fact.trim());\r
thumbUri = null;\r
}\r
\r
- Integer size = null;\r
-\r
- makeMediaRepresentation(media, uri, imageInfo, size);\r
+ makeMediaRepresentation(media, uri);\r
if (thumbUri != null){\r
- makeMediaRepresentation(media, thumbUri, thumbImageInfo, size);\r
+ makeMediaRepresentation(media, thumbUri);\r
}\r
\r
taxonDescription = taxon.getOrCreateImageGallery(sourceRef == null ? null :sourceRef.getTitleCache());\r
private Rights getSalvadorCopyright(String vol) {\r
String text;\r
if ("2009".equals(vol)){\r
- text = "(c) Botanic Garden and Botanical Museum Berlin-Dahlem & Asociación Jardín Botánico La Laguna. Berlin, Antiguo Cuscatlán 2009.";\r
+ text = "(c) Jardín Botánico y Museo Botánico Berlin-Dahlem & Asociación Jardín Botánico La Laguna. Berlin, Antiguo Cuscatlán 2009.";\r
}else if ("2012".equals(vol)){\r
- text = "(c) Botanic Garden and Botanical Museum Berlin-Dahlem & Asociación Jardín Botánico La Laguna. Berlin, Antiguo Cuscatlán 2012.";\r
+ text = "(c) Jardín Botánico y Museo Botánico Berlin-Dahlem & Asociación Jardín Botánico La Laguna. Berlin, Antiguo Cuscatlán 2012.";\r
}else if ("2016".equals(vol)){\r
text = "(c) Jardín Botánico y Museo Botánico Berlin-Dahlem & Asociación Jardín Botánico La Laguna. Berlin, Antiguo Cuscatlán 2016.";\r
}else{\r
* @param imageInfo\r
* @param size\r
*/\r
- private void makeMediaRepresentation(Media media, URI uri, ImageInfo imageInfo, Integer size) {\r
+ private void makeMediaRepresentation(Media media, URI uri) {\r
+ ImageInfo imageInfo = null;\r
+ Integer size = null;\r
+ try {\r
+ imageInfo = ImageInfo.NewInstance(uri, 0);\r
+ } catch (IOException | HttpException e) {\r
+ logger.error("Error when reading image meta: " + e + ", "+ uri.toString());\r
+ }\r
String mimeType = imageInfo == null ? null : imageInfo.getMimeType();\r
String suffix = imageInfo == null ? null : imageInfo.getSuffix();\r
MediaRepresentation mediaRepresentation = MediaRepresentation.NewInstance(mimeType, suffix);\r