Force regeneration of -scaled.jpg images?
Closed this issue · 1 comments
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.