Compare commits

..

No commits in common. "bc7a8a7a79c1bf81347698c53194e3432a5623c6" and "df603da5f8f047cc079b7552caa4789c58bc2fda" have entirely different histories.

2 changed files with 2 additions and 15 deletions

View file

@ -1,9 +0,0 @@
# Resize Pictures
Script used to generate images for my [personal blog](https://www.darkou.fr)
## Requirements
* libimage-exiftool-perl
* imagemagick
* bc

View file

@ -72,6 +72,8 @@ for image in {*.jpg,*.JPG} ; do
WIDTH=`identify -format "%[fx:w]" "${image}"`
HEIGHT=`identify -format "%[fx:h]" "${image}"`
echo ${WIDTH}x${HEIGHT}
# Compute image ratio
TMPIMAGERATIO=`bc -l <<< "${WIDTH}/${HEIGHT}"`
@ -109,9 +111,6 @@ for image in {*.jpg,*.JPG} ; do
# Rezise cover and save it
convert ${OPTIONS} -resize ${COVERWIDTH}x${COVERHEIGHT} "/tmp/${image}" "${DEST}/${image}"
# Convert to webp also
convert "${DEST}/${image}" -quality 50 "${DEST}/cover.webp"
# Remove temporary file
rm "/tmp/${image}"
else
@ -158,9 +157,6 @@ for image in {*.jpg,*.JPG} ; do
composite ${OPTIONS} -gravity SouthEast "${LOGO}" "${DESTPNG}/${filename}.png" "${DESTPNG}/${filename}.png"
convert "${DESTPNG}/${filename}.png" -type TrueColorAlpha -quality 90 -format PNG32 -background transparent -depth 8 -strip "${DESTPNG}/${filename}.png"
# Convert png file to webp file
convert "${DESTPNG}/${filename}.png" -quality 50 "${DESTPNG}/${filename}.webp"
fi
fi
done