Revision 9d43097c
Added by Andreas Müller over 3 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/media/in/MediaExcelImport.java | ||
---|---|---|
22 | 22 |
import org.joda.time.Partial; |
23 | 23 |
import org.springframework.stereotype.Component; |
24 | 24 |
|
25 |
import eu.etaxonomy.cdm.common.media.ImageInfo; |
|
25 |
import eu.etaxonomy.cdm.common.media.CdmImageInfo;
|
|
26 | 26 |
import eu.etaxonomy.cdm.io.common.utils.ImportDeduplicationHelper; |
27 | 27 |
import eu.etaxonomy.cdm.io.excel.common.ExcelImportBase; |
28 | 28 |
import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase; |
... | ... | |
223 | 223 |
} |
224 | 224 |
|
225 | 225 |
private void handleUri(MediaExcelImportState state, URI uri, Media media, String line) { |
226 |
ImageInfo imageInfo = null;
|
|
226 |
CdmImageInfo cdmImageInfo = null;
|
|
227 | 227 |
try { |
228 | 228 |
if (state.getConfig().isReadMediaData()){ |
229 |
imageInfo = ImageInfo.NewInstance(uri, 0);
|
|
229 |
cdmImageInfo = CdmImageInfo.NewInstance(uri, 0);
|
|
230 | 230 |
} |
231 | 231 |
} catch (Exception e) { |
232 | 232 |
String message = "An error occurred when trying to read image meta data for %s. Image was created but without metadata."; |
233 | 233 |
message = String.format(message, uri.toString()); |
234 | 234 |
state.getResult().addException(e, message, null, line); |
235 | 235 |
} |
236 |
ImageFile imageFile = ImageFile.NewInstance(uri, null, imageInfo);
|
|
236 |
ImageFile imageFile = ImageFile.NewInstance(uri, null, cdmImageInfo);
|
|
237 | 237 |
|
238 | 238 |
MediaRepresentation representation = MediaRepresentation.NewInstance(); |
239 | 239 |
|
240 |
if(imageInfo != null){
|
|
241 |
representation.setMimeType(imageInfo.getMimeType());
|
|
242 |
representation.setSuffix(imageInfo.getSuffix());
|
|
240 |
if(cdmImageInfo != null){
|
|
241 |
representation.setMimeType(cdmImageInfo.getMimeType());
|
|
242 |
representation.setSuffix(cdmImageInfo.getSuffix());
|
|
243 | 243 |
} |
244 | 244 |
representation.addRepresentationPart(imageFile); |
245 | 245 |
media.addRepresentation(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