Modify Alfresco Thumbnail Resolution

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

Modify Alfresco Thumbnail Resolution

Jump to solution

I'm using Alfresco Community v5.2.0 to store some files (pdf, jpg/png essentially).

I'm creating a web app to retrieve this files for a school project.

I'm trying to create a grid of files from a specific folder in my application.
But when i'm retrieving the list of a specific folders with their thumbnails, the resolution of the thumbnail is very low (100x75).

How to configure Alfresco to generate a larger thumbnail ?

I tried to override the settings in :

C:\alfresco-community\tomcat\webapps\alfresco\cmisfs\stylesheets\ thumbnails.xsl

But this didn't work..

I'm using Alfresco on my computer (windows), with REST API call. Where can i configure this resolution ?

Thanks in advance,

1 Solution

Accepted Solutions
Highlighted
Member II

Re: Modify Alfresco Thumbnail Resolution

Jump to solution

Wow thank you !

I found a way to ovveride the thumbnail definition :

I created a file

thumbnail-service-context.xml

in

[AlfrescoRootFolder]\tomcat\shared\classes\alfresco\extension\

In this file I wrote :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- 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="900"/>
<property name="height" value="900"/>
<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>
</beans>

And now I can retrieve a thumbnail by calling :

/alfresco/api/-default-/public/alfresco/versions/1/nodes/{idDocAlfresco}/renditions/doclib/content

View solution in original post

2 Replies
Highlighted
Master

Re: Modify Alfresco Thumbnail Resolution

Jump to solution

Where did you find the idea to modify / put the thumbnail.xsl there? This has nothing to do with the thumnail resolutions and is only related to displaying a CMIS-based file system view (as far as I can tell).

Alfresco thumbnails are defined in the thumbnail-service-context.xml (and can be overriden via a Spring bean context file in the shared/alfresco/extension/... path) - you can see the default definitions in the source file. You could add a custom thumbnail definition in your own Spring context file, and retrieve thumbnails created according to that definition for your project.

Highlighted
Member II

Re: Modify Alfresco Thumbnail Resolution

Jump to solution

Wow thank you !

I found a way to ovveride the thumbnail definition :

I created a file

thumbnail-service-context.xml

in

[AlfrescoRootFolder]\tomcat\shared\classes\alfresco\extension\

In this file I wrote :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- 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="900"/>
<property name="height" value="900"/>
<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>
</beans>

And now I can retrieve a thumbnail by calling :

/alfresco/api/-default-/public/alfresco/versions/1/nodes/{idDocAlfresco}/renditions/doclib/content

View solution in original post