Is there a Workaround in DM/DAM 5.5 to read EXIF/IPTC metadata on TIF files?
When I import JPG files with EXIF information it is read properly and reflected in the picture metadata in Nuxeo. However, when I try the same with TIF images I get an error (see dump below). I did notice that between 5.4.2 and 5.5 the following have been dropped … JAI-Adapter-0.9.5.jar, mlib_jai-1.1.2_01.jar, and possibly others(?). Even if I fix the PlanarImage error by adding required jars I still get the same error in ReadOp.createImageReader. I have, however, confirmed that the stream is readable (at least using FileUtils) by overriding the PictureChangedListener and reading the stream into a Byte array.
I haven't found the 0.9.5 source (although newer sources are available on bitbucket).
Is there any known workaround for this? Are their libraries missing in the 5.5 stream?
Thanks, Bruce.
2012-03-02 11:11:15,496 WARN [it.tidalwave.image.java2d.ImplementationFactoryJ2D] JAI not available: java.lang.ClassNotFoundException: javax.media.jai.PlanarImage
2012-03-02 11:11:15,509 INFO [it.tidalwave.image.op.ReadOp] readMetadata(java.io.BufferedInputStream@5c8c05, 0)
2012-03-02 11:11:16,128 ERROR [org.nuxeo.ecm.platform.picture.core.mistral.MistralMetadataUtils] Failed to get EXIF metadata
java.io.IOException: Cannot read from the inputstream
at it.tidalwave.image.op.ReadOp.createImageReader(ReadOp.java:470)
at it.tidalwave.image.op.ReadOp.access$000(ReadOp.java:57)
at it.tidalwave.image.op.ReadOp$Reader.run(ReadOp.java:113)
at it.tidalwave.image.op.ReadOp$Reader.read(ReadOp.java:89)
at it.tidalwave.image.op.ReadOp$Type$3.read(ReadOp.java:206)
at it.tidalwave.image.op.ReadOp.execute(ReadOp.java:332)
at it.tidalwave.image.EditableImage.create(EditableImage.java:239)
at org.nuxeo.ecm.platform.picture.core.mistral.MistralMetadataUtils.getImageMetadata(MistralMetadataUtils.java:76)
at org.nuxeo.ecm.platform.picture.ImagingComponent.getImageMetadata(ImagingComponent.java:106)
at org.nuxeo.ecm.platform.picture.api.adapters.AbstractPictureAdapter.setMetadata(AbstractPictureAdapter.java:213)
at org.nuxeo.ecm.platform.picture.api.adapters.DefaultPictureAdapter.createPicture(DefaultPictureAdapter.java:84)
at org.nuxeo.ecm.platform.picture.api.adapters.PictureBlobHolder.setBlob(PictureBlobHolder.java:82)
at org.nuxeo.ecm.platform.picture.listener.PictureChangedListener.handleEvent(PictureChangedListener.java:52)
at org.nuxeo.ecm.core.event.impl.EventServiceImpl.fireEvent(EventServiceImpl.java:195)
at org.nuxeo.ecm.core.api.AbstractSession.fireEvent(AbstractSession.java:343)
at org.nuxeo.ecm.core.api.AbstractSession.notifyEvent(AbstractSession.java:395)
at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:806)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:129)
at $Proxy24.createDocument(Unknown Source)
at org.nuxeo.ecm.platform.picture.extension.ImagePlugin.create(ImagePlugin.java:88)
at org.nuxeo.ecm.platform.filemanager.service.FileManagerService.createDocumentFromBlob(FileManagerService.java:249)
at org.nuxeo.ecm.platform.importer.factories.FileManagerDocumentModelFactory.createLeafNode(FileManagerDocumentModelFactory.java:50)
at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.doCreateLeafNode(GenericThreadedImportTask.java:215)
at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.recursiveCreateDocumentFromNode(GenericThreadedImportTask.java:330)
at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.recursiveCreateDocumentFromNode(GenericThreadedImportTask.java:325)
at org.nuxeo.ecm.platform.importer.base.GenericThreadedImportTask.run(GenericThreadedImportTask.java:371)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Using the newer version of the metadata-extractor (2.5.0-RC3) does solve this problem and opens up a much broader set of metadata for extraction. I started down the path of writing a wrapper for 2.5.0-RC3 to maintain backward compatibility with Nuxeo 5.5, but there are a fair number of connection points and it was easier just to adapt the listener and the newer extractor to purpose. Of course it would be better if 2.5.0-RC3 were wrapped into the core product!
More details on what I did and a code snippet.