ghostboard / ghost-purge-images

CLI tool to display & purge the uploaded images, video and audio files that currently are not used in any post, page or meta data
MIT License
90 stars 4 forks source link

Doesn't delete size variants, only original files #42

Open SteffoSpieler opened 2 months ago

SteffoSpieler commented 2 months ago

Size variants, being in images/size/w[xxxx]/xxxx/xx/xxxxxxx.png, don't get deleted by this tool.

SmithyAT commented 2 months ago

Just found your comment about that, looking for a solution to purge unused images. As far as I have seen, the variants in the size folder are automatically generated when there is a request. I tested that out with my site, removed the whole size folder and as soon as the page or post is loaded, the size folder is created again with the images in it. So you can run the script, then remove the size folder and lean back, the resized images were then generated again on the fly.