cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved]Created Thumbnail is size 0 bytes, nothing to see!

sgomez
Champ in-the-making
Champ in-the-making
I can successfully create a  thumbnail (I can confirm by seeing a new child node created after running webscript) but the file is size 0 for every thumbnail I create and so there is no actual thumbnail to preview.  I tried creating thumbnails based on the OOTB thumbnail definitions as well as Mr. Pott's own thumbnail definition from his example (http://ecmarchitect.com/archives/2009/03/03/913) and all thumbnails created are the same: size 0, no preview to see).

I've installed Imagemagick and can cofirm that it works through command line.  I've also installed ghostscript for office -> pdf transformationIs (not sure if I need this).  Is there anything else I am missing?  I am currently on Enterprise 3.1.  Below is a snippet in my js webscript.  I am in the process of trying out thumbnail creation through java-backed webscripts and I'll report if this will change anything. 


     var node = search.findNode(args['node']);
     var thumbnailName = "medium";

     if (node !== null) {
          node.createThumbnail(thumbnailName, true);
     }

Below is my log4j log:
15:03:06,932 DEBUG [org.alfresco.repo.thumbnail.ThumbnailServiceImpl] Getting thumbnail by name (nodeRef=workspace://SpacesStore/b8d3888d-ddc0-49a5-a14e-48fe1f1102df; contentProperty={http://www.alfresco.org/model/content/1.0}content; thumbnailName=medium)
15:03:07,025 DEBUG [org.alfresco.repo.thumbnail.ThumbnailServiceImpl] Creating thumbnail (node=workspace://SpacesStore/b8d3888d-ddc0-49a5-a14e-48fe1f1102df; contentProperty={http://www.alfresco.org/model/content/1.0}content; mimetype=image/jpeg
15:03:07,025 DEBUG [org.alfresco.repo.thumbnail.ThumbnailServiceImpl] Getting thumbnail by name (nodeRef=workspace://SpacesStore/b8d3888d-ddc0-49a5-a14e-48fe1f1102df; contentProperty={http://www.alfresco.org/model/content/1.0}content; thumbnailName=medium)
15:03:07,119 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
   source mimetype: image/png
   target mimetype: image/jpeg
   transformers: [ImageMagickContentTransformer[ average=0ms]]
15:03:07,135 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
   source mimetype: image/png
   target mimetype: image/jpeg
   transformers: [ImageMagickContentTransformer[ average=0ms]]
15:03:07,197 DEBUG [org.alfresco.util.exec.RuntimeExec] Execution result:
   os:         Windows XP
   command:    [C:/devtools/ImageMagick-6.5.7-Q16/imconvert, C:\devtools\apache-tomcat-6.0.18\temp\Alfresco\ImageMagickContentTransformer_source_6794085110837159309.png[0], -thumbnail, 100x100, C:\devtools\apache-tomcat-6.0.18\temp\Alfresco\ImageMagickContentTransformer_target_9019625159893596094.jpg]
   succeeded:  true
   exit code:  -1072365564
   out:       
   err:       
15:03:07,197 DEBUG [org.alfresco.repo.content.transform.magick.ImageMagickContentTransformer] ImageMagic executed successfully:
RuntimeExec:
   command:    C:/devtools/ImageMagick-6.5.7-Q16/imconvert ${source} SPLIT:${options} ${target}
   env props:  [Ljava.lang.String;@1b68215
   dir:        null
   os:         Windows XP

15:03:07,197 DEBUG [org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformer] Transformation completed:
   source: ContentAccessor[ contentUrl=store://2009/11/6/15/10/084d8016-2c73-4100-b19b-3c97ae35039f.bin, mimetype=image/png, size=53099, encoding=null, locale=en_US]
   target: ContentAccessor[ contentUrl=store://2009/12/7/15/3/06ffacba-e782-46cd-b87f-91f3a8488ef1.bin, mimetype=image/jpeg, size=0, encoding=null, locale=en_US]
   options: org.alfresco.repo.content.transform.magick.ImageTransformationOptions@ef107a
15:03:07,213 DEBUG [org.alfresco.repo.content.transform.AbstractContentTransformer2] Completed transformation:
   reader: ContentAccessor[ contentUrl=store://2009/11/6/15/10/084d8016-2c73-4100-b19b-3c97ae35039f.bin, mimetype=image/png, size=53099, encoding=null, locale=en_US]
   writer: ContentAccessor[ contentUrl=store://2009/12/7/15/3/06ffacba-e782-46cd-b87f-91f3a8488ef1.bin, mimetype=image/jpeg, size=0, encoding=null, locale=en_US]
   options: org.alfresco.repo.content.transform.magick.ImageTransformationOptions@ef107a
   transformer: ImageMagickContentTransformer[ average=78ms]
15:03:07,213 DEBUG [org.alfresco.repo.content.transform.ContentTransformerRegistry] Searched for transformer:
   source mimetype: image/jpeg
   target mimetype: text/plain
   transformers: []
9 REPLIES 9

nprando
Champ in-the-making
Champ in-the-making
I have the same problem with Community 3.2r2. Someone can help me?
Thanks

Nicola

stevegreenbaum
Champ in-the-making
Champ in-the-making

stevegreenbaum
Champ in-the-making
Champ in-the-making
I still can't successfully generate a thumbnail in Share, but I am able to generate a thumbnail using ImageMagick from the command line with no problem. 

I took the Command: from the log that was generated when debug is enable and it won't run without first removing the commas between each of the command parameters.  I was thinking that the log included the commas for readability, but I found another post where they can successfully generate a thumbnail and their command statement does not include commas between the parameters.  What would cause this difference in command?

Here is a sample from a successful execution that I found in another forum post - there are no commas between command parameters:

21:55:10,938 DEBUG [org.alfresco.util.exec.RuntimeExec] Execution result:
   os:         Linux
   command:    convert /opt/Alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformer_source_3101662635154708545.jpg  /opt/Alfresco/tomcat/temp/Alfresco/ImageMagickContentTransformer_target_4975277974653078577.jpg
   succeeded:  true
   exit code:  0
   out:
   err:

Here is the log from a zero byte size execution - note the commas between parameters in the command:

command:    [C:/devtools/ImageMagick-6.5.7-Q16/imconvert, C:\devtools\apache-tomcat-6.0.18\temp\Alfresco\ImageMagickContentTransformer_source_6794085110837159309.png[0], -thumbnail, 100x100, C:\devtools\apache-tomcat-6.0.18\temp\Alfresco\ImageMagickContentTransformer_target_9019625159893596094.jpg]

I am receiving the same exit code as the poster above:

   succeeded:  true
   exit code:  -1072365564

nprando
Champ in-the-making
Champ in-the-making
Hi all,
referring to this post http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=14528 I tried to add SystemRoot to imagemagick enviroment and it works!

So you have to add an entry in processProperties with key SYSTEMROOT and relative value (es. C:/WINDOWS) to imagemagick-transform-context.xml (or create a new one in alfresco/extension)


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>

   <bean id="transformer.worker.ImageMagick" class="org.alfresco.repo.content.transform.magick.ImageMagickContentTransformerWorker">

            <property name="processProperties">
               <map>
                  <entry key="MAGICK_HOME">
                     <value>${img.root}</value>
                  </entry>
                  <entry key="DYLD_LIBRARY_PATH">
                     <value>${img.dyn}</value>
                  </entry>
                  <entry key="LD_LIBRARY_PATH">
                     <value>${img.dyn}</value>
                  </entry>
                  <entry key="SYSTEMROOT">
                     <value>C:/WINDOWS</value>
                  </entry>
               </map>
            </property>


Restart alfresco and now exitcode is 0 and size > 0.

Nicola

stevegreenbaum
Champ in-the-making
Champ in-the-making
Nicola –

I've confirmed that the fix is working for me as well.  Thank you!  Great find.  Smiley Very Happy

I'd award give points on this, but the option isn't appearing.  Perhaps only the originator of the post can award points. 

So I take it that this is a Windows problem only.  Surprised more people haven't reported this issue.  Will you be posting to Jira?  I'd be happy to do that if you'd like.

nprando
Champ in-the-making
Champ in-the-making
Nicola –

I've confirmed that the fix is working for me as well.  Thank you!  Great find.  Smiley Very Happy

I'd award give points on this, but the option isn't appearing.  Perhaps only the originator of the post can award points. 

So I take it that this is a Windows problem only.  Surprised more people haven't reported this issue.  Will you be posting to Jira?  I'd be happy to do that if you'd like.

I'm not registered to jira. You can post it. Thanks

stevegreenbaum
Champ in-the-making
Champ in-the-making

sgomez
Champ in-the-making
Champ in-the-making
Thank you so much for keeping this thread alive.  I am very sorry for not keeping up with it.  But I will give credit where its due and that is to Nicola.  I've marked your solution as helpful.  Although I haven't tried it myself, it looks like it has helped someone already.  I will definitely give it a try as well hopefully after I'm done with my current task.  Again, thanks!

chandu7ee
Champ in-the-making
Champ in-the-making
Hi.,

I followed this blog (http://keytocontent.blogspot.com/2010/03/reviving-alfresco-share-thumbnail-and.html#comment-form) and  thumbnails working fine for most of the documents., but while uploading some pdf files i am having some error messages in my log file.
            even i am not able to get thumbnails for those pdf files. here is my log :

12:23:47,400 User:System DEBUG [content.transform.FailoverContentTransformer] All transformations were unsuccessful. Throwing latest exception.
org.alfresco.service.cmr.repository.ContentIOException: 07060004 Content conversion failed:
   reader: ContentAccessor[ contentUrl=store://2010/8/6/12/23/8667a330-53a6-4a6f-9633-3e5f55c7328c.bin, mimetype=application/pdf, size=13350510, encoding=UTF-8, locale=en_US]
   writer: ContentAccessor[ contentUrl=store://D:\Alfresco\ALC7A6~1\tomcat\temp\Alfresco\FailoverTransformer_intermediate_PdfBoxPdfToImageContentTransformer_8342091843480543110.png, mimetype=image/png, size=0, encoding=UTF-8, locale=en_US]
   options: ImageTransformationOptions[ commandOptions=, resizeOptions=org.alfresco.repo.content.transform.magick.ImageResizeOptions@1af4a4a]
        at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:176)
        at org.alfresco.repo.content.transform.FailoverContentTransformer.transformInternal(FailoverContentTransformer.java:164)
        at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:167)
        at org.alfresco.repo.content.transform.ComplexContentTransformer.transformInternal(ComplexContentTransformer.java:154)
        at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:167)
        at org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:544)
        at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$1.doWork(ThumbnailServiceImpl.java:265)
        at org.alfresco.repo.thumbnail.ThumbnailServiceImpl$1.doWork(ThumbnailServiceImpl.java:180)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:514)
        at org.alfresco.repo.thumbnail.ThumbnailServiceImpl.createThumbnail(ThumbnailServiceImpl.java:178)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:40)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:148)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy96.createThumbnail(Unknown Source)
        at org.alfresco.repo.thumbnail.CreateThumbnailActionExecuter.executeImpl(CreateThumbnailActionExecuter.java:115)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:127)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:711)
        at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:648)
        at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1$1.execute(AsynchronousActionExecutionQueueImpl.java:496)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:327)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:234)
        at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:505)
        at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:514)
        at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:508)
        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)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 07060003 PDF document is encrypted.
        at org.alfresco.repo.content.transform.PdfBoxPdfToImageContentTransformer.transformInternal(PdfBoxPdfToImageContentTransformer.java:84)
        at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:167)
        … 39 more