diff --git a/scripts/cavif b/scripts/cavif new file mode 100755 index 00000000..0483e599 Binary files /dev/null and b/scripts/cavif differ diff --git a/scripts/deploy-ebook-to-www b/scripts/deploy-ebook-to-www index f2011600..03ff2533 100755 --- a/scripts/deploy-ebook-to-www +++ b/scripts/deploy-ebook-to-www @@ -131,7 +131,7 @@ require "git" "Try: apt-get install git" require "php" "Try: apt-get install php-cli" require "se" "Read: https://standardebooks.org/tools" -# go-avif is compiled from https://github.com/Kagami/go-avif/ +# cavif is compiled via Cargo: https://github.com/kornelski/cavif-rs scriptsDir="$(dirname "$(readlink -f "$0")")" @@ -233,8 +233,8 @@ do convert -resize "1318" -crop "1318x439+0+659" -sampling-factor 4:2:0 -strip -quality 80 -colorspace RGB -interlace JPEG "${imgWorkDir}/${urlSafeIdentifier}.jpg" "${imgWorkDir}/${urlSafeIdentifier}-hero.jpg" convert -resize "2636" -crop "2636x860+0+1318" -sampling-factor 4:2:0 -strip -quality 80 -colorspace RGB -interlace JPEG "${imgWorkDir}/${urlSafeIdentifier}.jpg" "${imgWorkDir}/${urlSafeIdentifier}-hero@2x.jpg" - "${scriptsDir}"/go-avif -e "${imgWorkDir}/${urlSafeIdentifier}-hero.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-hero.avif" --best - "${scriptsDir}"/go-avif -e "${imgWorkDir}/${urlSafeIdentifier}-hero@2x.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-hero@2x.avif" --best + "${scriptsDir}"/cavif --quality 50 "${imgWorkDir}/${urlSafeIdentifier}-hero.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-hero.avif" + "${scriptsDir}"/cavif --quality 50 "${imgWorkDir}/${urlSafeIdentifier}-hero@2x.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-hero@2x.avif" # Build the cover image thumbnail # We use JPG instead of SVG for several reasons: @@ -247,9 +247,8 @@ do convert -resize "242" -sampling-factor 4:2:0 -strip -quality 80 -colorspace RGB -interlace JPEG "${imgWorkDir}/${urlSafeIdentifier}.svg" "${imgWorkDir}/${urlSafeIdentifier}-cover.jpg" convert -resize "484" -sampling-factor 4:2:0 -strip -quality 80 -colorspace RGB -interlace JPEG "${imgWorkDir}/${urlSafeIdentifier}.svg" "${imgWorkDir}/${urlSafeIdentifier}-cover@2x.jpg" - # go-avif is extremely slow and should be replaced with something faster ASAP - "${scriptsDir}"/go-avif -e "${imgWorkDir}/${urlSafeIdentifier}-cover.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-cover.avif" --best - "${scriptsDir}"/go-avif -e "${imgWorkDir}/${urlSafeIdentifier}-cover@2x.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-cover@2x.avif" --best + "${scriptsDir}"/cavif --quality 50 "${imgWorkDir}/${urlSafeIdentifier}-cover.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-cover.avif" + "${scriptsDir}"/cavif --quality 50 "${imgWorkDir}/${urlSafeIdentifier}-cover@2x.jpg" -o "${imgWorkDir}/${urlSafeIdentifier}-cover@2x.avif" sudo chgrp --preserve-root --recursive "${group}" "${imgWorkDir}/${urlSafeIdentifier}"* sudo chmod --preserve-root --recursive g+w "${imgWorkDir}/${urlSafeIdentifier}"* diff --git a/scripts/go-avif b/scripts/go-avif deleted file mode 100755 index a1e15264..00000000 Binary files a/scripts/go-avif and /dev/null differ