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

Force regeneration of -scaled.jpg images? #109

Closed
ddegner opened this issue Sep 7, 2020 · 1 comment
Closed

Force regeneration of -scaled.jpg images? #109

ddegner opened this issue Sep 7, 2020 · 1 comment

Comments

@ddegner
Copy link

ddegner commented Sep 7, 2020

While developing my wordpress site I had the "Disable "BIG image" Threshold" plugin installed half the time. So half of my images had a -scaled.jpg version and half didn't.

I found the default -scaled.jpg size to be too small so I want to use the "Regenerate Thumbnails" plugin to regen all the images to have a -scaled version. I removed the "Disable "Big Image"" plugin and added this to my function.php file.

function td_big_image_size_threshold( $threshold, $imagesize, $file, $attachment_id ) { return 4000; } add_filter( 'big_image_size_threshold', 'td_big_image_size_threshold', 10, 4 );

I ran the Regenerate plugin and it worked, creating -scaled.jpg images, for the half of the attachments that didn't previously have them, but didn't overwrite the previously created -scaled.jpg images.

I thought the updated pixel metadata of the -scaled.jpg images might be below the threshold so I went into the images.php file and temporarily removed that if($image_meta['width'] > X etc){} part of the check. It didn't work. Now I can't find a way to force a regenerated -scaled version of of the images. It is as if once they have been scaled once, even if those files are removed or the scale has changed they can't be scaled again.

I'm at a loss. I feel like running the _wp_image_meta_replace_original function over my whole library to reset them would be the best option but don't really know how to do that.

@renatho
Copy link
Contributor

renatho commented May 24, 2021

Closing this issue as duplicated to #104

@renatho renatho closed this as completed May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants