feat: added functions to optimize multiple common image formats
This commit is contained in:
1 parent
496fe13c7f
commit
1caf2a2590
1 file changed
+32
@@ -379,3 +379,35 @@ function git_cred
|
|||||||
echo "could not add the credentials helper"
|
echo "could not add the credentials helper"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
################ Optimize Pictures ##########################################################
|
||||||
|
|
||||||
|
function optimize-jpegs
|
||||||
|
if command -q jpegoptim
|
||||||
|
find . -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.jpe' \) -exec jpegoptim --strip-none {} +
|
||||||
|
else
|
||||||
|
echo "jpegoptim is not installed. Install it with: sudo pacman -S jpegoptim"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function optimize-pngs
|
||||||
|
if command -q oxipng
|
||||||
|
find . -type f -iname '*.png' -exec oxipng {} +
|
||||||
|
else
|
||||||
|
echo "oxipng is not installed. Install it with: sudo pacman -S oxipng"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function optimize-gifs
|
||||||
|
if command -q gifsicle
|
||||||
|
find . -type f -iname '*.gif' -exec gifsicle -b -O3 {} +
|
||||||
|
else
|
||||||
|
echo "gifsicle is not installed. Install it with: sudo pacman -S gifsicle"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function optimize-pictures
|
||||||
|
optimize-jpegs
|
||||||
|
optimize-pngs
|
||||||
|
optimize-gifs
|
||||||
|
end
|
||||||
Reference in new issue
Block a user