The problem creates a thumbnail after insertion

cancel
Showing results for 
Search instead for 
Did you mean: 
robertD
Member II

The problem creates a thumbnail after insertion

Hi,

I use alfresco 7.1.0 with embedded ImageMagick 7.0.10. In global.properties I have system.thumbnail.generate=true. In Tomcat I have file thumbnail-service-context.xml and I use CMIS connector.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<!-- This bean is responsible for the conversion of thumbnail definitions to
rendition definitions and vice versa -->
<bean id="thumbnailRenditionConvertor" class="org.alfresco.repo.thumbnail.ThumbnailRenditionConvertor">
<property name="renditionService" ref="renditionService" />
</bean>
<bean id="baseThumbnailDefinition" class="org.alfresco.repo.thumbnail.ThumbnailDefinition" abstract="true" init-method="register">
<property name="thumbnailRegistry">
<ref bean="thumbnailRegistry" />
</property>
</bean>
<bean id="defaultImageResizeOptions" class="org.alfresco.repo.content.transform.magick.ImageResizeOptions" abstract="true">
<property name="maintainAspectRatio" value="true" />
<property name="resizeToThumbnail" value="true" />
</bean>
<bean id="defaultImageTransformationOptions" class="org.alfresco.repo.content.transform.magick.ImageTransformationOptions" abstract="true">
<property name="timeoutMs" value="20000" />
<property name="readLimitTimeMs" value="-1" />
<property name="maxSourceSizeKBytes" value="25000" />
<property name="readLimitKBytes" value="-1" />
<property name="pageLimit" value="1" />
<property name="maxPages" value="-1" />
</bean>
<!-- Slingshot Document Library image thumbnail options -->
<!-- Note that this will auto-register with parent="baseThumbnailDefinition" in the future -->
<bean id="thumbnailDefinitionDoclib" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
<property name="name" value="doclib" />
<property name="mimetype" value="image/png" />
<property name="transformationOptions">
<bean parent="defaultImageTransformationOptions">
<property name="resizeOptions">
<bean parent="defaultImageResizeOptions">
<property name="width" value="120" />
<property name="height" value="120" />
<property name="allowEnlargement" value="false" />
</bean>
</property>
</bean>
</property>
<property name="placeHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_doclib.png" />
<property name="mimeAwarePlaceHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_doclib{0}.png" />
<property name="runAs" value="System" />
<property name="failureHandlingOptions" ref="standardFailureOptions" />
</bean>
<!-- Image preview thumbnail options -->
<!-- Note that this will auto-register with parent="baseThumbnailDefinition" in the future -->
<bean id="thumbnailDefinitionImgpreview" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
<property name="name" value="imgpreview" />
<property name="mimetype" value="image/jpeg" />
<property name="transformationOptions">
<bean parent="defaultImageTransformationOptions">
<property name="resizeOptions">
<bean parent="defaultImageResizeOptions">
<property name="width" value="120" />
<property name="height" value="120" />
<property name="allowEnlargement" value="false" />
</bean>
</property>
</bean>
</property>
<property name="placeHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_256.png" />
<property name="mimeAwarePlaceHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_256{0}.png" />
<property name="runAs" value="System" />
<property name="failureHandlingOptions" ref="standardFailureOptions" />
</bean>
<!-- Web Preview thumbnail options -->
<!-- Note that this will auto-register with parent="baseThumbnailDefinition" in the future -->
<bean id="thumbnailDefinitionWebpreview" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
<property name="name" value="webpreview" />
<property name="mimetype" value="application/x-shockwave-flash" />
<property name="transformationOptions">
<bean class="org.alfresco.repo.content.transform.swf.SWFTransformationOptions">
<property name="flashVersion" value="9" />
</bean>
</property>
<property name="runAs" value="System" />
<property name="failureHandlingOptions" ref="standardFailureOptions" />
</bean>
<!-- PDF Preview -->
<bean id="thumbnailDefinitionPDFpreview" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
<property name="name" value="pdf" />
<property name="mimetype" value="application/pdf" />
<property name="transformationOptions">
<!-- The thumbnail definition have transformationOptions mandatory -->
<!-- But there are none for pdf, so use SWFTransformationsOptions as a dummy -->
<bean class="org.alfresco.repo.content.transform.swf.SWFTransformationOptions">
<property name="flashVersion" value="9" />
</bean>
</property>
</bean>
<!-- Thumbnail Register -->
<bean id="thumbnailRegistry" parent="baseThumbnailRegistry" class="org.alfresco.repo.thumbnail.ThumbnailRegistry" />

<!-- failure options 86400s = 60s 60m 2h =1day -->
<bean id="standardFailureOptions" class="org.alfresco.repo.thumbnail.FailureHandlingOptions">
<property name="retryPeriod" value="100" />
<property name="retryCount" value="4" />
<property name="quietPeriod" value="7200" />
<property name="quietPeriodRetriesEnabled" value="true" />
</bean>
<!-- Create Thumbnail Action -->
<bean id="create-thumbnail" class="org.alfresco.repo.thumbnail.CreateThumbnailActionExecuter" parent="action-executer">
<property name="publicAction">
<value>false</value>
</property>
<property name="nodeService">
<ref bean="NodeService" />
</property>
<property name="thumbnailService">
<ref bean="ThumbnailService" />
</property>
<property name="mimetypeMaxSourceSizeKBytes">
<ref bean="mimetypeMaxSourceSizeKBytes" />
</property>
</bean>
<!-- Update Thumbnail Action -->
<bean id="update-thumbnail" class="org.alfresco.repo.thumbnail.UpdateThumbnailActionExecuter" parent="action-executer">
<property name="publicAction">
<value>false</value>
</property>
<property name="nodeService">
<ref bean="NodeService" />
</property>
<property name="renditionService">
<ref bean="RenditionService" />
</property>
<property name="thumbnailService">
<ref bean="ThumbnailService" />
</property>
<property name="mimetypeMaxSourceSizeKBytes">
<ref bean="mimetypeMaxSourceSizeKBytes" />
</property>
</bean>
<!-- Size limits (KBytes) by mimetype of original source content after which thumbnails
are not created. If the mimetype is not specified or the value is less than zero,
a thumbnail will be generated regardless of size. -->
<!-- extension from https://docs.alfresco.com/content-services/6.1/admin/transformations/ -->
<util:map id="mimetypeMaxSourceSizeKBytes" map-class="java.util.HashMap" key-type="java.lang.String" value-type="java.lang.String">
<entry key="application/pdf">
<value>-1</value>
</entry>
<entry key="text/plain">
<value>-1</value>
</entry>
<entry key="application/vnd.openxmlformats-officedocument.wordprocessingml.document">
<value>-1</value>
</entry>
<entry key="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<value>-1</value>
</entry>
<entry key="application/vnd.openxmlformats-officedocument.presentationml.presentation">
<value>-1</value>
</entry>
<entry key="application/vnd.oasis.opendocument.text">
<value>-1</value>
</entry>
<entry key="application/vnd.oasis.opendocument.spreadsheet">
<value>-1</value>
</entry>
<entry key="application/vnd.oasis.opendocument.presentation">
<value>-1</value>
</entry>
<entry key="application/x-gzip">
<value>0</value>
</entry>
<entry key="application/zip">
<value>0</value>
</entry>
<entry key="application/x-tar">
<value>0</value>
</entry>
<entry key="application/vnd.oasis.opendocument.image">
<value>20000</value>
</entry>
</util:map>
<!-- Thumbnail service script API -->
<bean id="thumbnailServiceScript" parent="baseJavaScriptExtension" class="org.alfresco.repo.thumbnail.script.ScriptThumbnailService">
<property name="extensionName">
<value>thumbnailService</value>
</property>
<!-- Creates ScriptNodes which require the ServiceRegistry -->
<property name="serviceRegistry" ref="ServiceRegistry" />
</bean>
<!-- This action filter bean prevents multiple equivalent create-thumbnail actions from executing
simultaneously in the Asynchronous Action Execution Service -->
<bean id="createThumbnailActionFilter" class="org.alfresco.repo.action.CreateThumbnailActionFilter" parent="baseActionFilter">
<property name="name">
<value>preventMultipleCreateThumbnailActions</value>
</property>
<!-- The action-definition-name against which this bean will be registered. -->
<property name="actionDefinitionName">
<value>create-thumbnail</value>
</property>
</bean>
</beans>

Alfresco does not automatically create a thumbnail. If I open a folder in Alfresco UI, then I will wait a few seconds to create a preview only, then do I have a preview in CMIS.

Can you please advise me what is wrong, if the thumbnail does not create itself after insertion?

Thanks,
Robo

1 Reply
abhinavmishra14
Advanced

Re: The problem creates a thumbnail after insertion

Legacy transformation is no longer available with ACS7. You have to use local transformation service.

Checkout the steps to setup local tr service here: https://hub.alfresco.com/t5/alfresco-content-services-forum/alfresco-comunity-7-zip-haven-t-alfresco...

The approach you are using is also deprecated. Use the new async RenditionService2.

Checkout this post as well:

https://hub.alfresco.com/t5/alfresco-content-services-blog/quick-reference-for-transformers-in-acs-c...

~Abhinav
(ACSCE, AWS SAA, Azure Admin)