Automattic / regenerate-thumbnails

WordPress plugin for regenerating thumbnails of uploaded images. Over 1 million active users and counting.
https://alex.blog/wordpress-plugins/regenerate-thumbnails/
GNU General Public License v2.0
133 stars 54 forks source link

all thumbnails are deleted if "Skip regenerating existing" and "Delete thumbnail files for old unregistered sizes" are checked #142

Closed codemonkeynorth closed 1 year ago

codemonkeynorth commented 1 year ago

I ran the plugin on 12,000+ media files (with v3.14)

I selected both Skip regenerating existing correctly sized thumbnails (faster) and Delete thumbnail files for old unregistered sizes

all of my thumbnails got wiped, leaving only the original images and -scaled versions

probably related to https://github.com/Automattic/regenerate-thumbnails/issues/136

(note I did previously clean up my Media Library with Media Cleaner Pro plugin to get rid of unused files, but I don't think it should've affected this)

thanks J

(updated to v3.15 but it isn't regenerating when using it on single images either... could be to do with theme setup I guess on where/when sizes are registered.. although they appear on the regenerate UI ok.. see screenshot)

image

codemonkeynorth commented 1 year ago

it was seemingly a problem with this in my theme

$sizes must be returning empty

function zgwd1010_filter_image_sizes( $sizes) {
    unset( $sizes['1536x1536']); // disable 2x medium-large size
    unset( $sizes['2048x2048']); // disable 2x large size
    return $sizes;
}
add_filter('intermediate_image_sizes_advanced', 'zgwd1010_filter_image_sizes');
aaronfc commented 1 year ago

This might be fixed by #143 (which at the same time fixes #136)

aaronfc commented 1 year ago

I have run a test and it seems like after #143 has been merged it is not an issue anymore. Closing the issue. Stay tunned for the next release.