cancel
Showing results for 
Search instead for 
Did you mean: 

thumbnail size issue for pdf

arpit_gupta
Champ in-the-making
Champ in-the-making
Hi All,

I am creating thumbnail for a pdf document.
For this i am using default thumbnail 'imgpreview' defined in thumbnail-service-context.xml
i can see in the config file that for 'imgpreview' thumbnail size is defined as 480x480.

But when i create thumbnail, size is 187x132.
i thought that it might be a problem of aspectRatio. and try with setting 'maintainAspectRatio' parameter as false in config.
But it does not affect.

also when i create thumbnail for images with same thumbnail definition('imgpreview'), i got the correct size.
So i am having this problem only for pdf files.

can someone please help me in this.

Thanks,
Arpit
3 REPLIES 3

arpit_gupta
Champ in-the-making
Champ in-the-making
Problem is very strange i can create pdf thumbnail of bigger size with custom thumbnail definition but i can not do the same with predefined thumbnail definitions. both the definition having same size parameters.

part of the thumbnail-service-context.xml —-


<bean class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
               <property name="name" value="scImageThumbnail" />
               <property name="mimetype" value="image/png"/>
               <property name="transformationOptions">
                  <bean  class="org.alfresco.repo.content.transform.magick.ImageTransformationOptions">
                     <property name="resizeOptions">
                        <bean class="org.alfresco.repo.content.transform.magick.ImageResizeOptions">
                           <property name="width" value="480"/>
                           <property name="height" value="480"/>
                           <property name="maintainAspectRatio" value="true"/>
                           <property name="resizeToThumbnail" value="true" />
                        </bean>
                     </property>
                  </bean>
               </property>
               <property name="runAs" value="System"/>
               <property name="placeHolderResourcePath" value="alfresco/extension/thumbnail/thumbnail_placeholder_scImageThumbnail.png" />
            </bean>

<bean class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
                <property name="name" value="imgpreview" />
                <property name="mimetype" value="image/png"/>
                <property name="transformationOptions">
                   <bean class="org.alfresco.repo.content.transform.magick.ImageTransformationOptions">
                      <property name="resizeOptions">
                         <bean class="org.alfresco.repo.content.transform.magick.ImageResizeOptions">
                            <property name="width" value="480"/>
                            <property name="height" value="480"/>
                            <property name="maintainAspectRatio" value="true"/>
                            <property name="resizeToThumbnail" value="true" />
                            <property name="allowEnlargement" value="false" />
                         </bean>
                      </property>
                   </bean>
                </property>
                <property name="placeHolderResourcePath" value="alfresco/thumbnail/thumbnail_placeholder_imgpreview.png" />
                <property name="runAs" value="System"/>
                <property name="failureHandlingOptions" ref="standardFailureOptions"/>
             </bean>



with 'scImageThumbnail' i can create pdf with the defined size.
But with 'imgpreview' i can not.

any idea why? or am i missing something.
also for images both the definitions are creating same size thumbnail which is correct?

Thanks,
Arpit

lista
Star Contributor
Star Contributor
Just by looking at your code, the "imgpreview" has the following piece of configuration.
<property name="allowEnlargement" value="false" />
If your document is actually smaller then the thumbnail you're trying to create, this could be the cause.

arpit_gupta
Champ in-the-making
Champ in-the-making
HI Lista,

It wasn't the case. my documents are atleast 5 times bigger than the thumbnail size.

Though i only have this problem on a window machine now i am on linux and not having this problem.
I think this was the problem of imagemagick installation on my window machine.

Thanks,
Arpit