Revision 9d43097c
Added by Andreas Müller almost 4 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmImportBase.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import eu.etaxonomy.cdm.api.application.ICdmRepository; |
26 | 26 |
import eu.etaxonomy.cdm.api.service.pager.Pager; |
27 |
import eu.etaxonomy.cdm.common.media.ImageInfo; |
|
27 |
import eu.etaxonomy.cdm.common.media.CdmImageInfo;
|
|
28 | 28 |
import eu.etaxonomy.cdm.io.common.mapping.IInputTransformer; |
29 | 29 |
import eu.etaxonomy.cdm.io.common.mapping.UndefinedTransformerMethodException; |
30 | 30 |
import eu.etaxonomy.cdm.io.markup.MarkupTransformer; |
... | ... | |
1424 | 1424 |
*/ |
1425 | 1425 |
private MediaRepresentation makeMediaRepresentation(String uriString, boolean readMediaData) throws URISyntaxException { |
1426 | 1426 |
uriString = uriString.replace(" ", "%20"); //replace whitespace |
1427 |
ImageInfo imageInfo = null;
|
|
1427 |
CdmImageInfo cdmImageInfo = null;
|
|
1428 | 1428 |
URI uri = new URI(uriString); |
1429 | 1429 |
|
1430 | 1430 |
try { |
1431 | 1431 |
if (readMediaData){ |
1432 | 1432 |
logger.info("Read media data from: " + uri); |
1433 |
imageInfo = ImageInfo.NewInstance(uri, 0);
|
|
1433 |
cdmImageInfo = CdmImageInfo.NewInstance(uri, 0);
|
|
1434 | 1434 |
} |
1435 | 1435 |
} catch (Exception e) { |
1436 | 1436 |
String message = "An error occurred when trying to read image meta data for " + uri.toString() + ": " + e.getMessage(); |
1437 | 1437 |
logger.warn(message); |
1438 | 1438 |
fireWarningEvent(message, "unknown location", 2, 0); |
1439 | 1439 |
} |
1440 |
ImageFile imageFile = ImageFile.NewInstance(uri, null, imageInfo);
|
|
1440 |
ImageFile imageFile = ImageFile.NewInstance(uri, null, cdmImageInfo);
|
|
1441 | 1441 |
|
1442 | 1442 |
MediaRepresentation representation = MediaRepresentation.NewInstance(); |
1443 | 1443 |
|
1444 |
if(imageInfo != null){
|
|
1445 |
representation.setMimeType(imageInfo.getMimeType());
|
|
1446 |
representation.setSuffix(imageInfo.getSuffix());
|
|
1444 |
if(cdmImageInfo != null){
|
|
1445 |
representation.setMimeType(cdmImageInfo.getMimeType());
|
|
1446 |
representation.setSuffix(cdmImageInfo.getSuffix());
|
|
1447 | 1447 |
} |
1448 | 1448 |
representation.addRepresentationPart(imageFile); |
1449 | 1449 |
return representation; |
Also available in: Unified diff
ref #9148 change the name of CDM class ImageInfo to CdmImageInfo to avoid name calsh with commons-imaging/ImageInfo