Skip to main content

Bulk resizing of images?

Comments

5 comments

  • Yakir Perlin

    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:

    https://www.nasa.gov/sites/default/files/styles/full_width_feature/public/thumbnails/image/iss055e006321.jpg

    And if we want to dynamic upload and transform the image you can do it like this:

    https://res.cloudinary.com/demo/image/fetch/w_300,q_auto,f_auto/https://www.nasa.gov/sites/default/files/styles/full_width_feature/public/thumbnails/image/iss055e006321.jpg

    For more information, please refer to our documentation.

    Please let me know if it helps you.

    Best,

    Yakir

     

    0
  • Frederick van Staden

    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
  • Tia Esguerra

    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
  • Frederick van Staden

    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
  • Tia Esguerra

    Hi Frederick, 

    Sounds good. Thanks for letting me know 😊

    Kind Regards, 

    Tia

    0

Post is closed for comments.