cloudinary-community / cloudinary-community/cloudinary-util

[Bug] Radius probably shouldn't be applied before cropping

Open
#234 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14
Forks
23
PR merge metrics
No merged PRs in 30d

Description

# **Bug Report**

If you try to crop and apply a border radius, the radius is applied before cropping, making it invisible

## **Is this a regression?**

No.

## **Steps To Reproduce the error**

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

## **Expected behaviour**

Visible border radius. This would be achieved by, e.g.:

```
https://res.cloudinary.com/my-cloud/image/upload/c_crop,w_800,h_600,g_auto/r_50/f_auto/q_auto/v1/my-public-id?_a=BATAXdDg0
```

Instead we get:

```
https://res.cloudinary.com/my-cloud/image/upload/r_50/c_crop,w_800,h_600,g_auto/f_auto/q_auto/v1/my-public-id?_a=BATAXdDg0
```

If the input image is bigger than 800x600, no border radius will be visible.

Reported by email by @tpiros

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.