I want to stop generate thumbnail, how can I do

I want to stop generate the thumbnail, how can I do
I can’t find any option in the document
what should I do by editing extensions/upload/config/setting.json

thank you very much

1 Like
  • Settings
    • Media Library

then turn of responsive and or size optimization

I already turn off the responsive and size optimization
But still upload the thumbnail automatically (only large, medium…etc disappear)
And I still can’t find any place to turn of thumbnailQQ

thanks

1 Like

As of V3.5.4. I couldn’t able to stop generating thumbnails for media library. I implemented a “hack” which can temporarily help for the requirement.

create extensions/upload/services/image-manipulation.js

const upload = require('strapi-plugin-upload/services/image-manipulation');

delete upload['generateThumbnail']

upload.generateThumbnail = function() {
    return null;
}

module.exports = upload
3 Likes

@waseem_akram I’m trying your snippet for strapi 4.0.5 and it’s not working for me :expressionless:

Did you upgrade to Strapi 4 ? and were you able to achieve same in Strapi 4?

Thanks for answer :slight_smile:

1 Like

I am curious too. My upload provider Cloudflare Images generates variants. The plan of cloudflare is handled by the number of images, while the variants are included in the pricing. So if Strapi needs a thumbnail, in this case it would be better if it gets its image size variant data by the media provider plugin strapi-provider-upload-cloudflare-2 - npm

Has anyone found a solution. When I upload an mp4 video, no thumbnail is created and I can NOT select the video in the content

I use strapi-version. 4.3.6

Thanks!

For v4 you can do the following. (I coudn’t find a better way to disable thumbnail generation)

Create the following file and restart the server:
src\extensions\upload\strapi-server.js

module.exports = (plugin) => {
    var imageManipulation = plugin.services['image-manipulation'];
    plugin.services['image-manipulation'] = () => {
        return {
            ...imageManipulation(),
            generateThumbnail: () => { }
        };
    };
    return plugin;
};
1 Like

In latest 4.6, I’ve been able to set it through breakpoints config in ./config/middlewares.js

module.exports = ({ env }) => ({
  upload: {
    config: {
      breakpoints: {
        // Comment or uncomment keys below to disable thumbnail creation.
        // Useful when you rely on services for image resizing (ie: vercel...) and
        // don't want to increase disk usage, backups..
        // Caution: this applies to new uploaded images.
        // xlarge: 1920,
        // large: 1000,
        // medium: 750,
        // small: 500,
        xsmall: 64
      },
    }
  },
});

See Upload - Strapi Developer Docs

1 Like

This is the only solution that seem to work but it is still only producing “xsmall” and “thumbnail”. i need a permanent resolution that will produce all other variants(xlarge, large, medium and small) as stipulated in the code. thank you.

here is my plugin.js code

module.exports = ({ env }) => ({
// …
upload: {
config: {
provider: “cloudinary”,
providerOptions: {
cloud_name: env(“CLOUDINARY_NAME”),
api_key: env(“CLOUDINARY_KEY”),
api_secret: env(“CLOUDINARY_SECRET”),
},
breakpoints: {
xlarge: 1920,
large: 1000,
medium: 750,
small: 500,
xsmall: 64,
},
actionOptions: {
upload: {},
delete: {},
},
},
},
// …
});