Cari tutti,
io e il mio collega abbiamo qualche problema con la creazione/upload di immagini in alfresco.
Abbiamo utilizzato i suggerimenti di David per la creazione del file ma sembra che qualcosa non vada a buon fine nella creazione della thumbnail e nella visualizzazione del file.
L'immagine png viene creata in una classe java, salvata su disco (o in alternativa restituita al volo) e successivamente restituita (come BufferedImage) nel file js.
Di seguito le istruzioni utilizzate nel js:
var userhome = companyhome.childByNamePath("User Homes/" + email);
var myUserfolder = userhome.createFolder("QR Code");
var image = codeGenerator.createCode(email,myUserfolder);
var doc = myUserfolder.createFile("test" + ".png");
doc.content = image;
doc.properties.content.write(doc.properties.content);
doc.properties.content.guessMimetype("test" + ".png".toLowerCase());
doc.properties.title = "titolo";
doc.properties.description = "descrizione";
doc.save();
Abbiamo quindi il file di log con alcuni errori:
2016-06-08 16:52:31,544 ERROR [org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl] [defaultAsyncAction5] Failed to execute asynchronous action: Action[ id=efab97e0-230f-495c-bd83-f3dde806ba6d, node=null ]: 05080021 Failed to perform ImageMagick transformation:
Execution result:
os: Windows 10
command: "C:\Users\Sviluppatore 3\cinema-ba-poc\imagemagick\imconvert.exe" C:\Users\SVILUP~1\AppData\Local\Temp\Alfresco\ImageMagickContentTransformerWorker_source_203437000961620418.png[0] -auto-orient -resize "100x100>" C:\Users\SVILUP~1\AppData\Local\Temp\Alfresco\ImageMagickContentTransformerWorker_target_7754908562306876172.png
succeeded: false
exit code: 1
out:
err: imconvert.exe: unable to load module `C:\Users\Sviluppatore 3\cinema-ba-poc\imagemagick\modules\coders\IM_MOD_RL_PNG_.dll': An unknown error occurred @ error/module.c/OpenModule/1282.
imconvert.exe: no decode delegate for this image format `PNG' @ e
org.alfresco.error.AlfrescoRuntimeException: 05080023 Creation of thumbnail 'doclib' failed
at org.alfresco.repo.thumbnail.CreateThumbnailActionExecuter.executeImpl(CreateThumbnailActionExecuter.java:206)
at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:267)
at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:839)
at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:740)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1$1.execute(AsynchronousActionExecutionQueueImpl.java:423)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:457)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:326)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper$1.doWork(AsynchronousActionExecutionQueueImpl.java:432)
at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)
at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)
at org.alfresco.repo.tenant.TenantUtil$1.doWork(TenantUtil.java:62)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548)
at org.alfresco.repo.tenant.TenantUtil.runAsUserTenant(TenantUtil.java:58)
at org.alfresco.repo.action.AsynchronousActionExecutionQueueImpl$ActionExecutionWrapper.run(AsynchronousActionExecutionQueueImpl.java:435)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 05080022 Content conversion failed:
reader: ContentAccessor[ contentUrl=store://2016/6/8/16/50/4dde4765-85d2-49ce-86af-0e6ce4b9640c.bin, mimetype=text/plain, size=280, encoding=UTF-8, locale=it_IT]
writer: ContentAccessor[ contentUrl=store://2016/6/8/16/52/945b48a5-205a-46e9-87e8-3e1abc8913a6.bin, mimetype=image/png, size=0, encoding=UTF-8, locale=it_IT]
options: {use=doclib, contentReaderNodeRef=workspace://SpacesStore/76f5daef-72cd-43f6-9cf8-18ab7de034be, contentWriterNodeRef=null, sourceContentProperty=null, imageAutoOrient=true, targetContentProperty=null, commandOptions=, imageResizeOptions=ImageResizeOptions [width=100, height=100, maintainAspectRatio=true, percentResize=false, resizeToThumbnail=false, allowEnlargement=false], includeEmbedded=null}
limits: {timeoutMs=120000, pageLimit=1}
claimed mime type: text/plain
detected mime type: text/plain
transformer not found
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:358)
at org.alfresco.repo.content.ContentServiceImpl.transform(ContentServiceImpl.java:631)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:129)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:159)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy73.transform(Unknown Source)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable$1.doWork(AbstractTransformationRenderingEngine.java:439)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable$1.doWork(AbstractTransformationRenderingEngine.java:1)
at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:548)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable.call(AbstractTransformationRenderingEngine.java:429)
at org.alfresco.repo.rendition.executer.AbstractTransformationRenderingEngine$TransformationCallable.call(AbstractTransformationRenderingEngine.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
… 3 more
Caused by: org.alfresco.service.cmr.repository.ContentIOException: 05080021 Failed to perform ImageMagick transformation:
Execution result:
os: Windows 10
command: "C:\Users\Sviluppatore 3\cinema-ba-poc\imagemagick\imconvert.exe" C:\Users\SVILUP~1\AppData\Local\Temp\Alfresco\ImageMagickContentTransformerWorker_source_203437000961620418.png[0] -auto-orient -resize "100x100>" C:\Users\SVILUP~1\AppData\Local\Temp\Alfresco\ImageMagickContentTransformerWorker_target_7754908562306876172.png
succeeded: false
exit code: 1
out:
err: imconvert.exe: unable to load module `C:\Users\Sviluppatore 3\cinema-ba-poc\imagemagick\modules\coders\IM_MOD_RL_PNG_.dll': An unknown error occurred @ error/module.c/OpenModule/1282.
imconvert.exe: no decode delegate for this image format `PNG' @ e
at org.alfresco.repo.content.transform.magick.ImageMagickContentTransformerWorker.transformInternal(ImageMagickContentTransformerWorker.java:198)
at org.alfresco.repo.content.transform.magick.AbstractImageMagickContentTransformerWorker.transform(AbstractImageMagickContentTransformerWorker.java:273)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy52.transform(Unknown Source)
at org.alfresco.repo.content.transform.ProxyContentTransformer.transformInternal(ProxyContentTransformer.java:100)
at org.alfresco.repo.content.transform.AbstractContentTransformer2.transform(AbstractContentTransformer2.java:250)
… 31 more
Nel log riscontriamo l'errore:
"imconvert.exe: unable to load module `C:\Users\Sviluppatore 3\cinema-ba-poc\imagemagick\modules\coders\IM_MOD_RL_PNG_.dll': An unknown error occurred @ error/module.c/OpenModule/1282."
la libreria cercata è "IM_MOD_RL_PNG_.dll" ma nella cartella coders è presente "IM_MOD_RL_png_.dll"
Grazie in anticipo a tutti quelli che vorranno darci una mano !