cloudinary/pkg-cloudinary-core

Transformation not chaining width

Closed this issue · 5 comments

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?

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.

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

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")

Tanks a lot @michalkcloudinay that did it.

Happy to help