Occasionally missing image formats on default file upload

strapi 3.2. 5

hello all,

on a new install of strapi, using the default image uploader…
some images missing format types… like medium for example.

this is an example api call
https://events-pr-back.herokuapp.com/events?id=60537fe67e695430905717da

“imageMain”:{
“_id”:“60537fde7e695430905717d9”,
“name”:“iliza_02.jpg”,
“alternativeText”:"",
“caption”:"",
“hash”:“iliza_02_aa97813c91”,
“ext”:".jpg",
“mime”:“image/jpeg”,
“size”:15.35,
“width”:650,
“height”:343,
“url”:"/uploads/iliza_02_aa97813c91.jpg",
“formats”:{
“thumbnail”:{
“name”:“thumbnail_iliza_02.jpg”,
“hash”:“thumbnail_iliza_02_aa97813c91”,
“ext”:".jpg",
“mime”:“image/jpeg”,
“width”:245,
“height”:129,
“size”:3.92,
“path”:null,
“url”:"/uploads/thumbnail_iliza_02_aa97813c91.jpg"
},
“small”:{
“name”:“small_iliza_02.jpg”,
“hash”:“small_iliza_02_aa97813c91”,
“ext”:".jpg",
“mime”:“image/jpeg”,
“width”:500,
“height”:264,
“size”:10.59,
“path”:null,
“url”:"/uploads/small_iliza_02_aa97813c91.jpg"
}
},

1 Like

It depends on the size of the original file as to what formats it will generate, see the following documentation:

your link say:

When the Enable responsive friendly upload setting is enabled in the settings panel the plugin will generate the following responsive image sizes:

Name Largest Dimension
large 1000px
medium 750px
small 500px

These sizes can be overridden in config/plugins.js:

so do you mean the reason for API response missing the Medium image format is because i haven’t override with config/plugins.js ???
so in another words, the override will solve the issue of missing image formats?

sorry i haven’t found any other content related to

It depends on the size of the original file as to what formats it will generate

can you be more specific?

the better question is what version of Strapi are you using, and which provider?

what version of Strapi are you using, and which provider?

thank you for asking: at my first post i have mentioned:
strapi 3.2. 5
using the default image upload provider…

this is my first time with the product - tesing the env…

I have the same Issue.
Sometimes some formats are missing.
I use the latest Strapi Version.

I am also having the same issue and facing problem to inject proper url in my frontend. All time I have check the img format is available or not.

Has anyone got the reason behind this?

UPDATE: I think I get the reason. When the size of an img is below 500px, it provides neither the medium nor the small format. Because the size of small format is 500px and that img is already smaller than 500px. However, if we create custom formats, like 64px, it does provide that format. Awesome!

I think I’ve just run into this as well.
This was frustrating for me as in testing I must have sampled files > the limit and so had used one that didn’t end up being used in production.
so long story short; code defensively around the image formats as you never know what you’re going to get based on people uploading files via the GUI.

2 Likes

hello same issue for me too, strapi latest

[date=2024-03-27 timemphasized textezone=“Asia/Jakarta”]