Is it possible to batch process images after they have been uploaded, on per album instance?

Comments

3 comments

  • Avatar
    Eric Pasos

    Hi Amy,

    The explicit method of the Upload API is mainly used to perform transformations on an already-existing resource in your Media Library account. And applying any image transformation can be done on each asset (i.e., one public_id at a time, using one of our client SDKs).

    For example:

    cloudinary.v2.uploader
    .explicit("sample", 
      { type: "upload",
        eager: [
          { width: 400, height: 400,
            crop: "crop", gravity: "face"}, 
          { width: 660, height: 400,
            crop: "pad", background: "blue"} ]})
    .then(result=>console.log(result));
    0
    Comment actions Permalink
  • Avatar
    Amy Stout

    Thank you; but so your code block above looks like something that would be one on the website end and not inside of the Cloudinary Media Library or am I confused? 

    I'm looking for something where my customer can upload albums and not worry about any of the sizing or optimizing and then I can go into the dashboard and apply transformations and optimizations all in one batch and then call them back down to his site... is this possible?  Sorry, I'm new with using Cloudinary and there seems like a lot to know about!   And as I asked before I'm not sure 'where on your site' I can look to figure all of this out as far as what I'm trying to do.  To be able to accomplish what I'm after where do I look and begin on the Cloudinary website?  

    Thanks again!  Amy

    0
    Comment actions Permalink
  • Avatar
    Tia Esguerra

    Hi Amy, 

    The code that Eric shared is written in Node.js You would run this code on your computer using, for example, VS Code or something similar. The explicit method is how you can programmatically apply actions to assets that were already uploaded to your account. 

    If you want to do this through the UI, you could create a named transformation. The syntax for including a named transformation in the URL is `t_<name of transformation>'. For example, if you create a named transformation with the name of 'abc', you could apply the named transformation to the asset with the public id of 'sample' as follows: https://res.cloudinary.com/demo/image/upload/t_abc/cld-sample.jpg 

    You can reference the documentation on named transformations here:
    https://cloudinary.com/documentation/image_transformations#named_transformations 

    If your customer knows ahead of time what actions they would like to apply to their assets, you can create an upload preset for them to use as they are uploading their assets. You can read about upload presets here: https://cloudinary.com/documentation/dam_admin_upload_presets 

    I hope this helps. Let me know if you have any questions.

    Kind Regards, 

    Tia

    0
    Comment actions Permalink

Please sign in to leave a comment.