Make WordPress Core

Opened 4 years ago

Last modified 20 months ago

#50396 new defect (bug)

Can't regenerate "-scaled.jpg" images

Reported by: mattiasf's profile mattiasf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.4.2
Component: Media Keywords: reporter-feedback
Focuses: Cc:


I have a lot of issues with images that has the "-scaled.jpg" extension.

When uploading images that are large enough to have the "-scaled.jpg" postfix, it's thumbnails is not generated. I have tracked this down to the original being missing.

Take forinstance this image: "earring-anpe-jamie.jpg". After I has been uploaded it resides within the /uploads/ directory as "earring-anpe-jamie-scaled.jpg", however, it has no assosciated thumbnails. If I run wp media regenerate <id> directly on it, it will fail with the warning: Warning: Can't find "Image Name" (ID 191697).

So I believe the issue is that WordPress is looking for the original image name, that does not have the -scaled postfix, however, for some reason it deos not exist. I have made a shellscript to copy all images in the "uploads" directoy that has the -scaled.jpg to it's equivilant image name without -scaled, e.g.

cp image-scaled.jpg image.jpg

I am not sure what caused this, but surely it brings a lot of missing images on our website as theres no thumbnails.

Change History (4)

This ticket was mentioned in Slack in #core-media by antpb. View the logs.

21 months ago

#2 @antpb
21 months ago

  • Keywords reporter-feedback added

Hi @mattiasf ! I wanted to check in on this and see if this was still an issue for you. I noticed in another ticket that you opened the image did exist and the wpcli command to regenerate was not finding the original image? Did that result in a WPCLI ticket to investigate? Would appreciate a link to that if so!

Do you think you could provide a sample image that is causing the issue with some reproduction steps to outline how to see this behavior. As far as I see taking happy paths it seems to be holding the original.

This ticket was mentioned in Slack in #core-media by joedolson. View the logs.

20 months ago

#4 @joedolson
20 months ago

The strange thing in this scenario is the missing original files. The first thing WordPress does when storing media is store the original upload, which we then never touch. So if the file with an unmodified image name is not present, that's opening up the potential for breaking any number of things.

Can you provide any information about how you might have ended up with those images missing, @mattiasf? Are there any plugins you're using that are managing media?

Note: See TracTickets for help on using tickets.