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

Image not optimization and not convert origin to webp #25

Open
neuliv opened this issue Sep 12, 2023 · 4 comments
Open

Image not optimization and not convert origin to webp #25

neuliv opened this issue Sep 12, 2023 · 4 comments

Comments

@neuliv
Copy link

neuliv commented Sep 12, 2023

I have added code in config/plugin.js

"image-optimizer": { enabled: true, config: { include: ["jpeg", "jpg", "png"], exclude: ["gif"], formats: ["original", "webp", "avif"], sizes: [ { name: "xs", width: 300, }, { name: "sm", width: 768, }, { name: "md", width: 1280, }, { name: "lg", width: 1920, }, { name: "xl", width: 2840, // Won't create an image larger than the original size withoutEnlargement: true, }, { // Uses original size but still transforms for formats name: "original", }, ], additionalResolutions: [1.5, 3], quality: 70, }, },

  also add code on src/extensions/upload/strapi-server.ts

`// ./src/extensions/upload/strapi-server.ts

import imageOptimizerService from "strapi-plugin-image-optimizer/dist/server/services/image-optimizer-service";

module.exports = (plugin) => {
plugin.services["image-manipulation"] = imageOptimizerService;
return plugin;
};`

@marlokessler
Copy link
Owner

Hi there, could you explain what the issue here is?

@neuliv
Copy link
Author

neuliv commented Sep 13, 2023

So the thing is we have implemaneted the image optimizer plugin, now we are have the uploaded the images but its not getting convert in Webp format and the size we have given in the plugn files its not getting the same size.
Also we have enbled image optimization in the media library, its stapi by defualt funtionlity. But we have disbale this as well and checked but didn't worked out for us.
Please let me know if we need to enble any addination setting, or the code which is shared above are correct or not?

It will be very helpful for us if you can help us in this. thanks

@neuliv
Copy link
Author

neuliv commented Sep 17, 2023

Hi @marlokessler have you gone through with the above query? We will be very grateful if you can help with this.

Thanks

@sarikajadhavneo
Copy link

sarikajadhavneo commented Nov 23, 2023

I am also
facing the same issue @neuliv , Have you received any solution for the above issue

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

3 participants