AnsweredAssumed Answered

Image transformation different in Labs 3 Final???

Question asked by spdaly on May 14, 2009
Latest reply on May 28, 2009 by spdaly
I have a set of extensions running running on an Alf Labs 3.0b server.  One of the behaviors takes a JPEG content and converts it to a PNG content and creates a new node.  Works fine.

I'm testing 3.0 Final with the same code.  The transformation fails for some reason!  The "built in" transform action works on the same JPEG source when in the UI. 

I haven't changed anything in the code.  The 3.0 Final is straight from the install except for the extension code.  I have re-reviewed all the ImageMagick docs and nothing looks wrong.

Any help would be appreciated!

Here's the Java:


   private void doTransform(NodeRef nodeRef, ContentReader contentReader, ImageTransformationOptions imageOptions) {
      logger.debug("Create contentWriter");
      ContentWriter contentWriter = contentService.getWriter(nodeRef, ContentModel.TYPE_CONTENT, true);
      contentWriter.setMimetype(MimetypeMap.MIMETYPE_IMAGE_PNG);
      contentWriter.setEncoding("UTF-8");
      
       // try to pre-empt the lack of a transformer      
        if (contentService.isTransformable(contentReader, contentWriter, imageOptions) == false) {
            throw new NoTransformerException(contentReader.getMimetype(), contentWriter.getMimetype());
        }
       
      this.imageMagickContentTransformer.transform(contentReader, contentWriter, imageOptions);
   }

And the log message:


14:14:18,378 User:admin DEBUG [alfresco.behavior.ArtBehavior] onCreateNode
14:14:18,397 User:admin DEBUG [alfresco.behavior.ArtBehavior] Get a nodeRef to the library folder
14:14:18,397 User:admin DEBUG [alfresco.behavior.ArtBehavior] Get a nodeRef for art and get a contentReader for image
14:14:18,399 User:admin DEBUG [alfresco.behavior.ArtBehavior] Create x80 node
14:14:18,423 User:admin DEBUG [alfresco.behavior.ArtBehavior] Create contentWriter
org.alfresco.service.cmr.repository.ContentIOException: Content conversion failed:
   reader: ContentAccessor[ contentUrl=store://2009/5/14/14/7/b6f04dcd-db60-4e74-bd34-dda33e1ec3bd.bin, mimetype=image/jpeg, size=138165, encoding=UTF-8, locale=en_US]
   writer: ContentAccessor[ contentUrl=store://2009/5/14/14/14/90f2bf5f-14f6-4518-b049-f6b5e0ce1909.bin, mimetype=image/png, size=0, encoding=UTF-8, locale=en_US]
   options: org.alfresco.repo.content.transform.magick.ImageTransformationOptions@3a68cf
   at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:225)
   at com.wearport.alfresco.behavior.ArtBehavior.doTransform(ArtBehavior.java:143)
   at com.wearport.alfresco.behavior.ArtBehavior.onCreateNode(ArtBehavior.java:86)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


Caused by: org.alfresco.error.AlfrescoRuntimeException: Unsuported transformation attempted:
   reader: ContentAccessor[ contentUrl=store://2009/5/14/14/7/b6f04dcd-db60-4e74-bd34-dda33e1ec3bd.bin, mimetype=image/jpeg, size=138165, encoding=UTF-8, locale=en_US]
   writer: ContentAccessor[ contentUrl=store://2009/5/14/14/14/90f2bf5f-14f6-4518-b049-f6b5e0ce1909.bin, mimetype=image/png, size=0, encoding=UTF-8, locale=en_US]
   at org.alfresco.repo.content.transform.AbstractContentTransformer2.checkTransformable(AbstractContentTransformer2.java:164)
   at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:213)
   … 54 more
14:14:18,455 User:admin DEBUG [content.transform.ContentTransformerRegistry] Searched for transformer:
   source mimetype: image/jpeg
   target mimetype: text/plain
   transformers: []

Outcomes