Skip to content

[Bug] url-loader ignores height option when crop mode is "limit" #231

@mikemclin

Description

@mikemclin

Bug Report

Describe the bug

The url-loader removes the height when the crop mode is set to limit. Therefore, it ignores the height portion of the "limit" transformation and only enforces a width limit.

Relevant code reference:

if (!["limit"].includes(crop) && typeof height === "number") {
transformations.push(`h_${height}`);
}

Steps To Reproduce the error

const url = constructCloudinaryUrl({
  options: {
    src: 'my-public-id',
    width: 800,
    height: 600
  },
  config: {
    cloud: {
      cloudName: 'my-cloud'
    }
  }
});

Expected behaviour

I expect the url to have a h_600 param

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions