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

Gutenberg Editor Image Scaling - Issues with Thumbnail Regenration - Missing Images #32441

Closed
shuttermuse opened this issue Jun 3, 2021 · 2 comments
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Enhancement A suggestion for improvement.

Comments

@shuttermuse
Copy link

When an image is inserted, either singularly, or with a gallery, Gutenberg is using the URL for the selected scaled version of the image. eg. image-name-500x1024.jpg

If a user changes their image sizes in Settings>Media, and then, as many people so often seem to suggest, regenerates their thumbnails using a plugin, this can cause major issues. Several of these thumbnail regeneration plugins delete (either by default or as an option) the old thumbnails.

With Gutenberg using the scaled image URL in the editor, this means when you go to edit an old post after doing this, all of your images are broken in the editor. When the post is viewed on the front end, there is no problem, but the editor will be filled with a mess of broken image icons. If someone does this by accident, it can be a while before the problem is realized. New posts will work fine, and old posts look ok on front end. The issue is only visible if you happen to go back and edit an old post. If your backup system does not keep backups for a longer period of time than it takes you to discover this issue, it could be a real headache that can only really be solved by deleting and then re-inserting all the images again into your old posts.

It would be great to have a way to prevent this. Perhaps by having the editor fall back to the URL of the original image when the scaled version is not available? Or by rewriting the scaled image URL to the URL of the closest new scaled version?

@talldan talldan added [Feature] Media Anything that impacts the experience of managing media Needs Technical Feedback Needs testing from a developer perspective. Needs Testing Needs further testing to be confirmed. labels Jun 14, 2021
@noisysocks noisysocks added [Type] Enhancement A suggestion for improvement. and removed Needs Testing Needs further testing to be confirmed. Needs Technical Feedback Needs testing from a developer perspective. labels Aug 31, 2021
@noisysocks
Copy link
Member

noisysocks commented Aug 31, 2021

Related: #28914, #23262

This was a problem in the classic editor, too.

I suppose the image block could detect when loading the image has a 404 error and use the stored image ID to change the stored URL to a new URL.

It wouldn’t totally be automatic, the user would have to press Update, but that might be a nice thing to do that’s not updating post_content in every single post (maybe not even practical e.g. on a site with lots of posts).

@Mamaduka
Copy link
Member

As noted in the previous comment, the issue isn't specific to the Block Editor, and it's up to plugins like Regenerate Thumbnails to replace old URLs with new ones.

I'm going to close this issue. General discussion for better handling deleted media continues in #23262.

@Mamaduka Mamaduka closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants