Bulk resizing of images?
Hello everyone,
I am Myers Kimberly. I want to konw if it is possible to bulk resize our images? We have a project related to SaaS, we are doing SaaS Content Marketing also, Right now we permit users to upload an image with no constraint. We want to impose an initial upload variation so that we can keep file sizes equitable, but we have a lot of images already uploaded and associated with user accounts. So my question is, Is it possible to bulk re-size those images and preserve their ids?
Any help appreciated!!!!
Thank you.
-
Hi,
I think you can use our fetch method, where you can dynamically (and lazy) upload images to Cloudinary while applying transformations per your needs, for example:
Let's work with this image, store on Nasa website:
And if we want to dynamic upload and transform the image you can do it like this:
For more information, please refer to our documentation.
Please let me know if it helps you.
Best,
Yakir
0 -
Reviving this old post - @yakir your proposed solution does not address the core issue here. I too am looking for a way to bulk resize images that were already uploaded in order to reduce storage costs on cloudinary.
0 -
Hi Frederick,
You can use a combination of the Admin API and the Upload API to accomplish this. First, you will want to use the resources method of the Admin API to grab all of your assets. Then you can loop over that list of assets and use the upload method of the Upload API to re-upload them, applying an incoming transformation to limit the size to your specification. You will want to be sure to include the parameters overwrite true and invalidate true in your upload method call.
Here are some links to documentation covering the APIs I mentioned above.
https://cloudinary.com/documentation/admin_api#get_resources
https://cloudinary.com/documentation/image_upload_api_reference#upload
Please give that a shot and let us know how it goes. If you have any questions, do not hesitate to ask.
Kind Regards,Tia
0 -
Many thanks Tia - I got a script up and running using the API but predict rate limits to be a problem. Have reached out to support.
0 -
Hi Frederick,
Sounds good. Thanks for letting me know 😊
Kind Regards,
Tia
0
Post is closed for comments.
Comments
5 comments