We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi
In version 2.2.1 i get an error when loading an image:
2.2.1
[2024-04-11 23:30:20.440] error: Expected one of: av1, hevc for compression but received undefined of type undefined Error: Expected one of: av1, hevc for compression but received undefined of type undefined at Object.invalidParameterError (/home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]/node_modules/sharp/lib/is.js:135:10) at Sharp.heif (/home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]/node_modules/sharp/lib/output.js:1069:16) at sharpAddFormatSettings (/home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:82:10) at resizeFileTo (/home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:52:21) at generateImage (/home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:44:21) at /home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:28:38 at Array.forEach (<anonymous>) at /home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:27:15 at Array.forEach (<anonymous>) at optimizeImage (/home/l/dev/landing/service/cms/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service.js:26:13)
I think this is due to the fact that when sharpInstance is initialized, the compression parameter is not passed for heif option:
sharpInstance
compression
heif
strapi-plugin-image-optimizer/server/services/image-optimizer-service.ts
Lines 128 to 138 in 26a3212
Sharp documentation: https://sharp.pixelplumbing.com/api-output#heif
I use the following plugin configuration:
'image-optimizer': { enabled: true, config: { include: ["jpeg", "jpg", "png"], exclude: ["gif"], formats: ["original", "webp"], sizes: [ { name: "xs", width: 300, }, { name: "sm", width: 768, }, { name: "md", width: 1280, }, { name: "lg", width: 1920, }, { name: "xl", width: 2840, withoutEnlargement: true, }, { name: "original", }, ], additionalResolutions: [1.5, 3], quality: 70, } satisfies ImageOptimizerConfig }
The text was updated successfully, but these errors were encountered:
Same issue here.
Sorry, something went wrong.
After this commit lovell/sharp@3043e01 compress option in heic becomes mandatory. lovell/sharp#3740 So try to downgrade to sharp to 0.32.6 version
compress
heic
0.32.6
No branches or pull requests
Hi
In version
2.2.1
i get an error when loading an image:I think this is due to the fact that when
sharpInstance
is initialized, thecompression
parameter is not passed forheif
option:strapi-plugin-image-optimizer/server/services/image-optimizer-service.ts
Lines 128 to 138 in 26a3212
Sharp documentation: https://sharp.pixelplumbing.com/api-output#heif
I use the following plugin configuration:
The text was updated successfully, but these errors were encountered: