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

Expected positive integer for height but received 2779.5 of type number #27

Open
longd3 opened this issue Sep 17, 2023 · 4 comments
Open

Comments

@longd3
Copy link

longd3 commented Sep 17, 2023

I exactly used default config but kept getting this error:

Error: Expected positive integer for height but received 2779.5 of type number
    at Object.invalidParameterError (/node_modules/sharp/lib/is.js:135:10)
    at Sharp.resize (/node_modules/sharp/lib/resize.js:287:18)
    at sharpAddResizeSettings (/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:88:26)
    at resizeFileTo (/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:51:21)
    at generateImage (/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:42:21)
    at /node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:29:46
    at Array.forEach (<anonymous>)
    at /node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:28:39
    at Array.forEach (<anonymous>)
    at /node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:25:15
@netzpixel
Copy link

Same. Why is this still open?

@christophebe
Copy link

Same issue

@rosareyes
Copy link

same?

@raku3
Copy link

raku3 commented Jul 26, 2024

additionalResolutions: [1.5, 3],
↑ remove

It appears that you have resized the image and as a result the file specifies a pixel dimension with a decimal point.
Files containing decimal points will result in an error

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

5 participants