generating thumbnails in Alfresco

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

generating thumbnails in Alfresco

I am developing CMIS based application code to get thumbnails from the Alfresco repository. But thumbnails are not available immediately after insertion. How can I set CMIS when creating a file, pls? Can I set up on Map<String, Object>, ContentStream, or another way to start doclib creation?

I want to do something similar to JavaScript.
document.createThumbnail("scImageThumbnail", true);

Or is it just about setting the Alfresco?

Thanks.

9 Replies
angelborroy
Alfresco Employee

Re: generating thumbnails in Alfresco

The action to create a rendition (the thumbnail) can't be fired from CMIS API (afaik). So you need to wait for Alfresco to create that and once this happens, you can get the rendition by using Rendition API.

Sample code for this operation is available in @jpotts reply to this question: https://stackoverflow.com/questions/38655368/how-to-get-rendition-copy-of-word-document-from-alfresc...

Hyland Developer Evangelist
RobertDudas
Member II

Re: generating thumbnails in Alfresco

I use this GET request for thumbnail, works if doc lib is created. But doc lib is only generated if I open the Alfresco UI with this file.

Is it possible to append the OperationContext to the GET request parameter ?c=force via CMIS?

In ALF7 I have these parameters in alfresco-global. properties:

    transform.service.enabled=true
    local.transform.service.enabled=true
    messaging.subsystem.autoStart=true
    alfresco.restApi.basicAuthScheme=true

 Is there anything else to add?

Is there a lazy evaluation of thumbnails in alfresco? If so, how do I turn it off? I need to ensure that ALF creates a thumbnail immediately after inserting the file via CMIS.

Thanks

angelborroy
Alfresco Employee

Re: generating thumbnails in Alfresco

In order to create a new rendition (after the inserting the file using CMIS) you need to use the Alfresco REST API:

https://api-explorer.alfresco.com/api-explorer/#/renditions/createRendition

There is no option available from CMIS Client.

Hyland Developer Evangelist
RobertDudas
Member II

Re: generating thumbnails in Alfresco

In ALF6, thumbnails were generated from documents(pdf, txt, pptx, csv, etc) immediately after insertion. Only thumbnails from images were not generated automatically. What's the rendition in ALF6 and ALF7 different?

angelborroy
Alfresco Employee

Re: generating thumbnails in Alfresco

Not sure if that is the root cause, but Transformers changed from ACS 6.2:

https://docs.alfresco.com/content-services/latest/develop/repo-ext-points/content-transformers-rendi...

On the other hand, I've found this property:

https://github.com/Alfresco/alfresco-community-repo/blob/master/repository/src/main/resources/alfres...

You'll find additional details in:

https://github.com/Alfresco/alfresco-community-repo/commit/3ad33034f122af679e9ad065b59d6906939cc58e

Note that this is also an asynchronous operation.

Hyland Developer Evangelist
RobertDudas
Member II

Re: generating thumbnails in Alfresco

Thank you for the advice, REST generating thumbnail is functioning perfectly. Could you also give me advice on how to set up CMIS, please?
cmis.create.doc.request.renditions.set=
I have already tried to set up doclib, thumbnail, scImageThumbnail yet it has not to trigger the correct transformation.
In the case of CMIS is error thumbnail="true" against REST transformation. If the transformation is started using CMIS, then doclib is not created. It is created only after the REST call.

 

angelborroy
Alfresco Employee

Re: generating thumbnails in Alfresco

This should be working:

cmis.create.doc.request.renditions.set=doclib,pdf

What Alfresco version are you using?

Hyland Developer Evangelist
RobertDudas
Member II

Re: generating thumbnails in Alfresco

In ALF7 with embedded ImageMagick works perfectly.
But I need it to work for ALF6.
In ALF6 works only documents. It does not create a thumbnail from the images.
In ALF6 I have this configuration.

img.root=/usr/lib64/ImageMagick-7.0.7
img.coders=/usr/lib64/ImageMagick-7.0.7/modules-Q16HDRI/coders
img.config=/usr/lib64/ImageMagick-7.0.7/config-Q16HDRI
img.exe=/usr/bin/convert

alfresco.restApi.basicAuthScheme=true
messaging.subsystem.autoStart=false

Do I need to add anything else for ALF6, pls?

angelborroy
Alfresco Employee

Re: generating thumbnails in Alfresco

That feature is only available from Alfresco 7, so no option to use that in Alfresco 6.

Hyland Developer Evangelist