hscc

Soure code of <https://hugo.soucy.cc>.
git clone git://soucy.cc/hscc.git
Log | Files | Refs

commit f2f74c4fbc9b5794ff9daf27d0e279274ae59441
parent 22fbc013ad0692b4305b086aceb4bdd67e90929a
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue, 26 Oct 2021 22:14:37 -0400

Modify bin scripts

Diffstat:
Rbin/img -> bin/_backup/img | 0
Abin/optimizimages | 35+++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/bin/img b/bin/_backup/img diff --git a/bin/optimizimages b/bin/optimizimages @@ -0,0 +1,35 @@ +#!/bin/sh + +# script for optimizing images in a directory (recursive) +# pngcrush & jpegtran settings from: +# http://developer.yahoo.com/performance/rules.html#opt_images + +# pngquant +for png in `find $1 -iname "*.png"`; do + echo "crushing $png ..." + #pngcrush -rem alla -reduce -brute "$png" temp.png + pngquant "$png" --floyd=0.5 --ext -op.png --force --strip --skip-if-larger + + # preserve original on error + # if [ $? = 0 ]; then + # mv -f temp.png $png + # else + # rm temp.png + # fi +done + +# jpegtran +for jpg in `find $1 -iname "*.jpg"`; do + echo "crushing $jpg ..." + jpegtran -copy none -optimize -perfect "$jpg" > temp.jpg + + # preserve original on error + # if [ $? = 0 ]; then + # mv -f temp.jpg $jpg + # else + # rm temp.jpg + # fi +done + +# Ce script semble intéressant: +# <https://github.com/VirtuBox/img-optimize>