How to search Cloudinary by folder and transform?
I'm using the Node SDK to fetch all images from a specific folder in Cloudinary:
const res = await cloudinary.v2.search.expression('folder:folder_name/subfolder_name')
.max_results(12)
.execute();
The images being returned are ~2-3 MB though, and so I'm needing to additionally transform them before sending them to my frontend. Is this possible with the Search API, or is there a better way to handle this?
-
Hi Jimmie,
Thanks for reaching out.
It will not be possible to transform assets with the Search API. For creating transformations of your existing assets, you can use the explicit method of the Upload API. Using the 'eager' parameter will allow you to keep your original asset intact while creating an additional derived version(s) of that asset.
You can reference that documentation here:
https://cloudinary.com/documentation/image_upload_api_reference#explicit_optional_parameters:~:text=.mp3.-,eager,-StringI hope this helps. Let me know if you have any questions.
Kind Regards,
Tia
0
Post is closed for comments.
Comments
1 comment