cloudinary / pkg-cloudinary-core

Distribution repository for the Cloudinary JavaScript library. Cloudinary is an end-to-end solution for all your image and video needs.
MIT License
54 stars 28 forks source link

Transformation not chaining width #26

Closed alessandrojcm closed 5 years ago

alessandrojcm commented 5 years ago

Hi there, I'm training to create the following transformation:

transform = new cloudinary.Transformation()
      .effect("blur:3000")
      .fetchFormat("auto")
      .gravity("auto")
      .quality("10")
      .chain()
      .aspectRatio("16:9")
      .color(themeColors.blue)
      .effect("colorize:30")
      .chain()
      .width(width); // This is inside a function, width is passed as a parameter

But with is not present in the transformation url, although all the other transformations are. If I take the url from the DevTools and append the width the image is fetched just fine. Any idea on why this happens?

michalkcloudinay commented 5 years ago

Hi,

In order to assist you better, could you please provide me with more information regarding your inquiry? What SDK are you using? Did you check that the "width" parameter is a valid number?

Please send me the URL you are receiving. Waiting for your response.

alessandrojcm commented 5 years ago

Hi @michalkcloudinay, sure. Regarding the SDK I'm using cloudinary-core@2.6.3; regarding the width, yes, I've console.log it and it is a valid number.

The url I'm getting is this one

michalkcloudinay commented 5 years ago

Hi @alessandrojcm, Using our SDK requires including a crop mode when using width. The following works: transform = new cloudinary.Transformation() .effect("blur:3000") .fetchFormat("auto") .gravity("auto") .quality("10") .chain() .aspectRatio("16:9") .color(themeColors.blue) .effect("colorize:30") .chain() .width(width) .crop("scale")

alessandrojcm commented 5 years ago

Tanks a lot @michalkcloudinay that did it.

michalkcloudinay commented 5 years ago

Happy to help