Created
March 10, 2023 21:58
-
-
Save Shnatsel/3effeeaa09b7ae7fc1ea4dc9cf1c98d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
input="$1" | |
output1="$(mktemp --tmpdir result_XXXXXXXXXXXXX.ppm)" | |
output2="$(mktemp --tmpdir result_XXXXXXXXXXXXX.ppm)" | |
trap "rm -f "$output1" "$output2"" EXIT | |
if ! yes | /home/shnatsel/Code/zune-image/target/release/zune --safe --input "$input" --out "$output1" >/dev/null 2>&1; then | |
echo "Failed to decode safe $input" | |
exit 1 | |
fi | |
if ! yes | /home/shnatsel/Code/zune-image/target/release/zune --input "$input" --out "$output2" >/dev/null 2>&1; then | |
echo "Failed to decode unsafe $input" | |
exit 1 | |
fi | |
similarity=$(compare -quiet -metric RMSE "$output1" "$output2" /dev/null 2>&1) || true | |
echo "$similarity $input" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment