<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can't generate picture thumbnails in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327787#M14788</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm getting the stacktrace below each time I upload a picture ; it must be a configuration issue since I'm only getting this on my pre-production server, but I don't get why.&lt;/P&gt;
&lt;P&gt;ImageMagick is installed and can be launched by the user behind the Nuxeo process. "convert -version" returns:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Version: ImageMagick 6.6.9-7 2012-08-17 Q16 &lt;A href="http://www.imagemagick.org" target="test_blank"&gt;http://www.imagemagick.org&lt;/A&gt;&lt;BR /&gt; /&amp;gt;
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC&lt;BR /&gt; /&amp;gt;
Features: OpenMP&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I'm using Nuxeo 5.7.1. Did anyone ever run into a similar error? Thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;2013-06-25 17:55:31,655 ERROR [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: PictureViewsGenerationWork(RUNNING, Progress(0.0%, ?/0), null)
org.nuxeo.ecm.core.api.ClientException: Failed to save document DocumentModelImpl(649ce38e-92f6-4d7f-9c49-432fb874b97b, path=/asset-library/Test Thumb, title=Test Thumb)
    at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1989)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:133)
    at com.sun.proxy.$Proxy44.saveDocument(Unknown Source)
    at org.nuxeo.ecm.platform.picture.PictureViewsGenerationWork.work(PictureViewsGenerationWork.java:45)
    at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:164)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.nuxeo.ecm.core.api.DocumentException: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1154)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLContentProperty.setValue(SQLContentProperty.java:80)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setValue(SQLComplexProperty.java:101)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setList(SQLComplexListProperty.java:278)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setValue(SQLComplexListProperty.java:86)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:222)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178)
    at org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:298)
    at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:541)
    at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1961)
    ... 11 more
Caused by: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed
    at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:315)
    at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.getBinary(ConnectionImpl.java:161)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1152)
    ... 20 more
Caused by: java.io.IOException: Stream Closed
    at java.io.FileInputStream.available(Native Method)
    at org.nuxeo.ecm.core.storage.sql.AbstractBinaryManager.storeAndDigest(AbstractBinaryManager.java:97)
    at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.storeAndDigest(LocalBinaryManager.java:176)
    at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.getBinary(LocalBinaryManager.java:114)
    at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:313)
    ... 22 more
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Jun 2013 18:23:57 GMT</pubDate>
    <dc:creator>Marwane_K_A_</dc:creator>
    <dc:date>2013-06-25T18:23:57Z</dc:date>
    <item>
      <title>Can't generate picture thumbnails</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327787#M14788</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm getting the stacktrace below each time I upload a picture ; it must be a configuration issue since I'm only getting this on my pre-production server, but I don't get why.&lt;/P&gt;
&lt;P&gt;ImageMagick is installed and can be launched by the user behind the Nuxeo process. "convert -version" returns:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Version: ImageMagick 6.6.9-7 2012-08-17 Q16 &lt;A href="http://www.imagemagick.org" target="test_blank"&gt;http://www.imagemagick.org&lt;/A&gt;&lt;BR /&gt; /&amp;gt;
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC&lt;BR /&gt; /&amp;gt;
Features: OpenMP&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I'm using Nuxeo 5.7.1. Did anyone ever run into a similar error? Thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;2013-06-25 17:55:31,655 ERROR [org.nuxeo.ecm.core.work.AbstractWork] Exception during work: PictureViewsGenerationWork(RUNNING, Progress(0.0%, ?/0), null)
org.nuxeo.ecm.core.api.ClientException: Failed to save document DocumentModelImpl(649ce38e-92f6-4d7f-9c49-432fb874b97b, path=/asset-library/Test Thumb, title=Test Thumb)
    at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1989)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.nuxeo.ecm.core.api.TransactionalCoreSessionWrapper.invoke(TransactionalCoreSessionWrapper.java:133)
    at com.sun.proxy.$Proxy44.saveDocument(Unknown Source)
    at org.nuxeo.ecm.platform.picture.PictureViewsGenerationWork.work(PictureViewsGenerationWork.java:45)
    at org.nuxeo.ecm.core.work.AbstractWork.run(AbstractWork.java:164)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.nuxeo.ecm.core.api.DocumentException: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1154)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLContentProperty.setValue(SQLContentProperty.java:80)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setValue(SQLComplexProperty.java:101)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setList(SQLComplexListProperty.java:278)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexListProperty.setValue(SQLComplexListProperty.java:86)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:222)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178)
    at org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:298)
    at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:541)
    at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1961)
    ... 11 more
Caused by: org.nuxeo.ecm.core.storage.StorageException: java.io.IOException: Stream Closed
    at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:315)
    at org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.getBinary(ConnectionImpl.java:161)
    at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.getBinary(SQLSession.java:1152)
    ... 20 more
Caused by: java.io.IOException: Stream Closed
    at java.io.FileInputStream.available(Native Method)
    at org.nuxeo.ecm.core.storage.sql.AbstractBinaryManager.storeAndDigest(AbstractBinaryManager.java:97)
    at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.storeAndDigest(LocalBinaryManager.java:176)
    at org.nuxeo.ecm.core.storage.sql.LocalBinaryManager.getBinary(LocalBinaryManager.java:114)
    at org.nuxeo.ecm.core.storage.sql.SessionImpl.getBinary(SessionImpl.java:313)
    ... 22 more
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jun 2013 18:23:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327787#M14788</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-06-25T18:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can't generate picture thumbnails</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327788#M14789</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2013 12:10:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327788#M14789</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-09-02T12:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can't generate picture thumbnails</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327789#M14790</link>
      <description>&lt;P&gt;I figured out that the bug is caused by the use of an InputStreamBlob to store temporarily the original picture ; the blob is somehow broken when time comes to save the document (maybe the stream is read before?).&lt;/P&gt;
&lt;P&gt;I hacked it by overriding the &lt;EM&gt;PictureViewListener + PictureViewsGenerationWork&lt;/EM&gt;, replacing the blob right after the thumbnails generation:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;org.nuxeo.ecm.platform.picture.PictureViewsGenerationWork&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;        ...
        picture.fillPictureViews(blob, filename, title, pictureTemplates);
  
        // Fix original picture
        String originalContentXpath = picture.getViewXPath("Original") + "content";
        Serializable originalContent = workingDocument.getPropertyValue(originalContentXpath);
        if (originalContent instanceof InputStreamBlob) {
            InputStreamBlob originalContentBlob = (InputStreamBlob) originalContent;
            Blob persistedBlob = originalContentBlob.persist();
            workingDocument.setPropertyValue(originalContentXpath, (Serializable) persistedBlob);
        }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Sep 2013 09:52:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327789#M14790</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-09-04T09:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can't generate picture thumbnails</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327790#M14791</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2013 17:16:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327790#M14791</guid>
      <dc:creator>Thomas_Roger</dc:creator>
      <dc:date>2013-09-04T17:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can't generate picture thumbnails</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327791#M14792</link>
      <description>&lt;P&gt;Hi Thomas,&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2013 17:46:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/can-t-generate-picture-thumbnails/m-p/327791#M14792</guid>
      <dc:creator>Marwane_K_A_</dc:creator>
      <dc:date>2013-09-04T17:46:24Z</dc:date>
    </item>
  </channel>
</rss>

