Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mikemclin opened this issue Jan 24, 2025 · 0 comments
Open

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

mikemclin opened this issue Jan 24, 2025 · 0 comments

Comments

@mikemclin
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant