From 41ca3f1fb5cae5d9613b3e4d8e71e5b952034614 Mon Sep 17 00:00:00 2001 From: Dym Sohin Date: Sun, 27 Aug 2023 01:45:07 +0200 Subject: [PATCH] add .avif --- readme.md | 2 ++ rename-ext.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 88a91b4..25ec08b 100644 --- a/readme.md +++ b/readme.md @@ -36,6 +36,8 @@ to only print a report: - [`file`](https://darwinsys.com/file/) - to determine file type - [`sd`](https://github.com/chmln/sd) – better sed - [`jpegoptim`](https://github.com/tjko/jpegoptim) – to compress JPEGs +- [`imagemagick`](https://imagemagick.org/) + or [`graphicsmagic`](http://www.graphicsmagick.org/) – to mogrify PNGs - [`pngcrush`](https://github.com/Kjuly/pngcrush) – to compress PNGs diff --git a/rename-ext.sh b/rename-ext.sh index cfe04da..191596c 100755 --- a/rename-ext.sh +++ b/rename-ext.sh @@ -17,6 +17,7 @@ # - file - to determine file type # - `cargo install sd` – better sed # - jpegoptim – to compress JPEGs +# - imagemagick or graphicsmagic – to mogrify PNGs # - pngcrush – to compress PNGs (losless) # // - pngquant – to compress PNGs (lossy) @@ -25,7 +26,7 @@ ALL_EXTS=`echo \ |eps|tga|tiff?|psd|ico|xcf|heic |eot|otf|ttf|epub|doc|docx|xls|swf|pdf|odt |flac|opus|ogg|m4a|wav - |mpe?g|mp\d|mov|mkv|avif?|asf|3gpp? + |mpe?g|mp\d|mov|mkv|avif?|asf|3gpp?|av1 |html?|sh|py|php ' \ | tr -d '[:space:]' \ @@ -232,6 +233,7 @@ for FILENAME in "$@"; do 'image/jp2') rename_ext "$FILENAME" 'jp2' ;; 'image/png') rename_ext "$FILENAME" 'png' ;; 'image/webp') rename_ext "$FILENAME" 'webp' ;; + 'image/avif') rename_ext "$FILENAME" 'avif' ;; # vector-based 'image/svg+xml') rename_ext "$FILENAME" 'svg' ;;