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

Image not optimization and not convert origin to webp #25

@neuliv

Description

@neuliv

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;
};`

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