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

Ignore Webp files #34

Closed ltoinel closed 1 year ago

ltoinel commented 2 years ago

Hi,

Thank-you for this script that saves my life ! :-) All my images are also compressed in Webp when they are uploaded in jpg.

I would like to avoid the script to remove all the used Webp images that are indirectly used because the original file is still use by a content.

Do you known how to implement this rules quickly ?

Thank-you,

dburgos commented 1 year ago

Hello @ltoinel

Good news, just released version 3.3.0 including the new optional param exclude-ext for this purpose. Adding ... --exclude-ext=webp when executing ghost-purge-imges and the webp files will be ignored. 💡 You can also exclude more than 1 file extensions just adding a comma, for example: ... --exclude-ext=webp,jpeg

Hope it helps, thank you!