Open dmitriy-nz opened 7 months ago
Tracked the issue to this clampDimensionsPreservingAspectRatio
fn call. Sharp seems to handle this correctly now, as works as expected when those lines are commented out. I'd question wether this manual patching still needed.
Environment
ipx - 2.0.2 nodejs - v18.16.1
Reproduction
Clone repo: https://github.com/dmitriy-nz/ipx-test Install deps Run
npx ipx serve --dir ./imgs
Open url: http://localhost:3000/s_200x200,fit_inside/test.jpg - Already at this step you will get an image with an incorrect sizeOn the native sharp everything works as expected with the same set of parameters Run
node index.js
for get the expected result via a nativesharp
Checkoutput.jpg
Describe the bug
When I try to resize a "skinny" image I get the wrong result.
Original image (30x600):![test](https://github.com/unjs/ipx/assets/51157176/688f50c2-a889-45b3-aaaf-e961b727fad3)
Call resize via ipx with parameters![test](https://github.com/unjs/ipx/assets/51157176/904ed44d-44d8-4ef6-922b-14aceb3b5eb8)
s_200x200,fit_inside
and get wrong result (1x30):I ran the resize with the same parameters through native sharp and everything works as expected (10x200):![output](https://github.com/unjs/ipx/assets/51157176/38073427-8895-4627-bff5-1b3dd3e2942c)
Additional context
No response
Logs
No response