Last active
July 28, 2022 14:38
-
-
Save MikelArnaiz/5a7787517a9351677c5f8e45816bf297 to your computer and use it in GitHub Desktop.
test imgproxy sizes
This file contains hidden or 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/bash | |
id=c6cde936-ae71-4c3e-9ed6-9f65e225f001 | |
sizes=( 285 700 1000 1200 1500 2000 ) | |
formats=( "jpg" "webp" "avif" ) | |
datafile="$id.csv" | |
echo "Creating $id.csv" | |
echo "width,quality,jpg,webp,avif" > $datafile | |
for w in "${sizes[@]}" | |
do | |
for q in {25..100..5} | |
do | |
echo -n "$w,$q," >> $datafile | |
for ext in "${formats[@]}" | |
do | |
filename="$id-$w-$ext-$q.$ext" | |
url="https://cdn.catawiki.net/image/q:$q/w:$w/plain/assets/catawiki/assets/2022/7/13/c/6/c/original_$id.jpg@$ext" | |
echo "downloading $url" | |
curl --output "$filename" -q -H "$COOKIE" $url | |
size=$(stat -f %z "$filename" | awk '{print $1/1024","}') | |
echo -n $size >> $datafile | |
done | |
echo "" >> $datafile | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment