Skip to content

Instantly share code, notes, and snippets.

@MikelArnaiz
Last active July 28, 2022 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikelArnaiz/5a7787517a9351677c5f8e45816bf297 to your computer and use it in GitHub Desktop.
Save MikelArnaiz/5a7787517a9351677c5f8e45816bf297 to your computer and use it in GitHub Desktop.
test imgproxy sizes
!/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