blurhash-update/scripts/hash.sh
asonix 45f5238f45
All checks were successful
/ tests (push) Successful in 45s
/ clippy (push) Successful in 13s
/ check (aarch64-unknown-linux-musl) (push) Successful in 7s
/ check (armv7-unknown-linux-musleabihf) (push) Successful in 7s
/ check (x86_64-unknown-linux-musl) (push) Successful in 6s
demo script - hash first frame
2024-03-06 13:28:59 -06:00

19 lines
358 B
Bash
Executable file

#!/usr/bin/env bash
set -e
if ! [ -f "$1" ]; then
echo "$1" is not a file;
exit 1;
fi
json=$(magick convert "$1[0]" JSON:-)
width=$(echo $json | jq '.[0].image.geometry.width')
height=$(echo $json | jq '.[0].image.geometry.height')
magick convert "$1[0]" RGBA:- | \
cargo r --example stdin --release -- \
--width $width \
--height $height