Image display using Renditions

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

Image display using Renditions

I have uploaded an image to alfreso repository. Renditions are also generated for the image file node.

Now I want to get image and display in front-end. Which Alfresco API can be used to create image-url using the renditions from the image. Please suggest what can be done to cretae - imageUrl for  <img [src] = "imageUrl"> in html file.

Please suggest.

Thanks,

Santosh. 

1 Reply
jpotts
Professional

Re: Image display using Renditions

You can use either the CMIS API or the Public REST API to list renditions. Here is the Public REST API swagger docs on renditions: https://api-explorer.alfresco.com/api-explorer/#!/renditions/listRenditions

Once you have the node reference of the rendition you want, you can refer to it similar to any other node reference. Here is a link that downloads the image from Alfresco:

http://localhost:8080/alfresco/s/api/node/workspace/SpacesStore/e061a117-009f-4a3b-9c25-f5238c669d87/content/thumbnails/doclib

Here is the same link, but this one includes arguments for that cause the rendition to be queued for creation if it does not already exist (queue) and one that returns the placeholder image if the rendition does not already exist (ph).

http://localhost:8080/alfresco/s/api/node/workspace/SpacesStore/e061a117-009f-4a3b-9c25-f5238c669d87/content/thumbnails/doclib?c=queue&ph=true

If instead you want to download the image using the user's Share session, you would do so via the Share proxy, like:

http://localhost:8080/share/proxy/alfresco/api/node/workspace/SpacesStore/e061a117-009f-4a3b-9c25-f5238c669d87/content/thumbnails/doclib?c=queue&ph=true

Hope that helps.