Revision 727e2bb3
Added by Niels Hoffmann almost 13 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmImportBase.java | ||
---|---|---|
646 | 646 |
if( multimediaObject == null){ |
647 | 647 |
return null; |
648 | 648 |
} else { |
649 |
ImageInfo imd = null;
|
|
649 |
ImageInfo imageInfo = null;
|
|
650 | 650 |
URI uri; |
651 | 651 |
try { |
652 | 652 |
uri = new URI(multimediaObject); |
653 | 653 |
try { |
654 | 654 |
if (readDataFromUrl){ |
655 |
imd = ImageInfo.NewInstance(uri, 0);
|
|
655 |
imageInfo = ImageInfo.NewInstance(uri, 0);
|
|
656 | 656 |
} |
657 | 657 |
} catch (Exception e) { |
658 | 658 |
String message = "An error occurred when trying to read image meta data: " + e.getMessage(); |
659 | 659 |
logger.warn(message); |
660 | 660 |
} |
661 |
ImageFile imf = ImageFile.NewInstance(uri, null, imd);
|
|
661 |
ImageFile imageFile = ImageFile.NewInstance(uri, null, imageInfo);
|
|
662 | 662 |
MediaRepresentation representation = MediaRepresentation.NewInstance(); |
663 |
representation.setMimeType(imd.getMimeType()); |
|
664 |
representation.addRepresentationPart(imf); |
|
663 |
if(imageInfo != null){ |
|
664 |
representation.setMimeType(imageInfo.getMimeType()); |
|
665 |
} |
|
666 |
representation.addRepresentationPart(imageFile); |
|
665 | 667 |
Media media = Media.NewInstance(); |
666 | 668 |
media.addRepresentation(representation); |
667 | 669 |
return media; |
Also available in: Unified diff
Fixed a failing test