withoutReduction: true - does not stop from downscaling images
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 32.7k
- Forks
- 1.4k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Description
### What are the steps to reproduce?
An image of size 500x500 will get resized to 400 despite the `withoutReduction: true` flag.
```js
sharp('large.png')
.resize(400, 400, {
withoutReduction: true
}).toFile('small.png');
```
### What is the expected behaviour?
Only smaller images should be resized (upscaled) to 400px
Trying to resize a larger image than 400x400 should due to `withoutReduction: true` should result in an image with with the dimensions of the original image, effectively not performing any resizing.
### version:
"sharp": "^0.31.3",
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the resize(400, 400, { withoutReduction: true }) example with a 500x500 image and inspect the resize implementation and existing resize tests. Done means larger images retain their original dimensions while smaller images can still be upscaled to 400px, with the relevant behavior covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100