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

Float/Double number passed to sharp #91

Closed
cxa opened this issue May 7, 2021 · 1 comment
Closed

Float/Double number passed to sharp #91

cxa opened this issue May 7, 2021 · 1 comment

Comments

@cxa
Copy link
Contributor

cxa commented May 7, 2021

I encountered errors that sharp not accepted width/height number such like 10.475xxxx. I think this two lines should use Math.round too:

https://github.com/JonasKruckenberg/imagetools/blob/main/packages/core/src/transforms/resize.ts#L82

https://github.com/JonasKruckenberg/imagetools/blob/main/packages/core/src/transforms/resize.ts#L87

(I intended to contribute but has no time to write tests, sorry).

@JonasKruckenberg
Copy link
Owner

JonasKruckenberg commented May 7, 2021

Thanks for the feedback! I refactored the directive and made it both easier to read but more importantly fixed this issue.
ìmagetools-core@2.7.0, vite-imagetools@3.6.1 or rollup-plugin-imagetools@2.2.1 include this fix.

JonasKruckenberg added a commit that referenced this issue May 7, 2021
This simplifies the resize directive and fixes issue #91
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

2 participants