Plex-Image-Cleanup icon indicating copy to clipboard operation
Plex-Image-Cleanup copied to clipboard

[Feature]: Only remove actual bloat images (i.e. EXIF tagged)

Open planetrocky opened this issue 4 months ago • 1 comments

Describe the Feature Request

This script is great, but it removes all the alternate artwork and posters that are stored. On a large collection it can take Plex a very long time to repopulate these, and on a CPU bound low-power NAS, it really impacts operation for a few days until it’s restored.

Ideally only the Kometa “bloat” images should be removed or at least an option to control this.

A check on each image before removal should be easy to add:

Taken from modules/library.py of Kometa as an example.

This shows the operation from Kometa:

with Image.open(image_path) as image:
            exif_tags = image.getexif()
        if 0x04bc in exif_tags and exif_tags[0x04bc] == "overlay":
            os.remove(image_path)
            raise Failed("This item's poster already has an Overlay. There is no Kometa setting to change; manual attention required.")
        if remove:
            os.remove(image_path)
        else:
            return image_path

planetrocky avatar Oct 08 '24 17:10 planetrocky