Cropping and zooming returning distorted images
- Dominant language
- C#
- Stars
- 583
- Forks
- 169
- PR merge metrics
- No merged PRs in 30d
Description
When using zoom combined with `mode=crop`, returned image has its original dimensions, with cropped area streched to its dimensions.
Example: http://resizer.apphb.com/fountain-small.jpg?w=1000&h=1200&mode=crop&zoom=1.8

The problem seems to appear above some threshold (when width of the resized image exceeds the original dimension)
Also, it does not respect that images should not be upscaled by default, for example: http://resizer.apphb.com/fountain-small.jpg?w=1000&h=1200&mode=crop&zoom=1.5 returns image resized to 1500x1800, although original size, cropped version of image is 1000x1200 fragment.
Interestingly, everything works fine if add `crop` parameters:
http://resizer.apphb.com/fountain-small.jpg?w=1000&h=1200&mode=crop&zoom=23&crop=0,0,1000,1200
Contributor guide
Research direction
Start by reproducing the two linked resizer.apphb.com examples using mode=crop with zoom, then inspect the image-resizing path that handles the crop and zoom parameters. Done means the cropped result keeps the requested dimensions without distortion and does not upscale beyond the original image unless explicit crop parameters allow it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100