Support » Plugin: Image Regenerate & Select Crop » Cleaning up unused sizes

  • Resolved Gal Baras

    (@galbaras)


    This plugin is great and seems to be doing a good job with many options and good visibility.

    I couldn’t find a way to remove unused sizes, say, after changing media settings. Is there a way I’ve missed?

    If not, this would be a great feature, both as a global function and as part of the Image Details box, i.e. show extra thumbnails and provide a way to selectively delete them.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Since posting this, I’ve found the “cleanup” buttons on the plugin settings page and used them successfully.

    However, when listing image details, the plugin only lists registered sizes that it knows about, and old sizes, that are no longer defined, are not listed, even when they are present in the attachment meta data and even when there is a file that matches the old size.

    Can you please make it so that image details contain every existing size, even if it’s not registered?

    BTW, I tried to add the sizes and then clean them up, but the original ones contained hyphens, e.g. “product-thumbnails”, and were converted to “product_thumbnails” (with an underscore).

    It took me a while to figure this out!

    The only way I got rid of them was by using add_media_size() and matching the size names precisely to what I found in the database.

    It would have been great to be able to discover old sizes and remove them, even when they are not registered.

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Hi Gal,

    I just released 5.1 which included more options for what you are describing you need: the two new cleanup types from the plugin settings page which allows to cleanup all attachments, and individual attachment info in the image details lightbox.

    Please note that the general cleanup is recommended for the command line, this might give unexpected results on a production site, so please use it with caution.

    Let me know if this works for you.

    Regards,
    Iulia

    Hi Lulia,

    There seems to be a problem updating, likely because 5.0.1 was labeled 5.01 (so I’ve been told by @pento). Can you please bump up the version to 5.1.1?

    Thank you,
    Gal

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Done.
    Thanks for letting me know. Please try again. I put 5.2 just to be sure 🙂

    Regards,
    Iulia

    Yes, that’s now usable. I will check the changes and let you know.

    Thank you!

    Hi Iulia,

    I added a media size, regenerated its thumbnail on an image, and then removed it. The Image Details & Sizes popup showed it as being present, but not registered.

    I then clicked Cleanup Unused and the extra thumbnail disappeared from the file system and from the image details.

    Looks like this one works. Well done.

    However, after regenerating all the thumbnails for an image in the media library, there is an entry for every thumbnail size, only some of them are the original file. This is probably going to cause compatibility issues.

    Cheers,
    Gal

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    Please provide a screenshot with the details, and I will check.

    https://1drv.ms/u/s!AvYtwWI4b_-wsz1vtQdtf4NtXG18?e=OQ1bEM

    The image is only 400px wide, but there is a meta entry for medium_large, which is 768px wide, linked to the original image.

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    I do not see the entire details about this, as the info at the bottom of the lightbox. Can you send that too?

    The fact that you see the info in the square about the shared file, that is not an issue, it is the default behavior for WordPress, as, if there is no custom file generated separately for the image size, it falls-back to the only image available, which is the full size/original.

    However, I am waiting for the rest of the information if you can provide it, to confirm that this is not a bug.

    Regards,
    Iulia

    • This reply was modified 1 month, 2 weeks ago by Iulia Cazan.

    https://1drv.ms/u/s!AvYtwWI4b_-wsz70TszsNzCyw6Vy?e=BtmYU4

    The meta data for the image shows this:

    [sizes] => Array
    (
    [medium] => Array
    (
    [file] => thermal-imaging-3-330×248.jpg
    [width] => 330
    [height] => 248
    [mime-type] => image/jpeg
    )
    [thumbnail] => Array
    (
    [file] => thermal-imaging-3-150×150.jpg
    [width] => 150
    [height] => 150
    [mime-type] => image/jpeg
    )
    [medium_large] => Array
    (
    [file] => thermal-imaging-3.jpg
    [width] => 400
    [height] => 301
    [mime] => image/jpeg
    )
    [large] => Array
    (
    [file] => thermal-imaging-3.jpg
    [width] => 400
    [height] => 301
    [mime] => image/jpeg
    )
    [project-single] => Array
    (
    [file] => thermal-imaging-3.jpg
    [width] => 400
    [height] => 301
    [mime] => image/jpeg
    )
    )

    • This reply was modified 1 month, 2 weeks ago by Gal Baras.
    Plugin Author Iulia Cazan

    (@iulia-cazan)

    That seems fine to me.

    It’s not. There should not be anything there for sizes that are larger than the original.

    Plugin Author Iulia Cazan

    (@iulia-cazan)

    I will take a look again.
    What WP core version do you use?

    5.2.4

Viewing 15 replies - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.