Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

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

@longd3

Description

@longd3

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions