2026-07-17
fuckup

seems like i crapped the orientation

https://til.simonwillison.net/exif/orientation-and-location

#!/bin/sh -Cefu


set -Cefu


_size()
{
	local file="$1"
	
	
	exiftool -n -csv -Orientation -ImageWidth -ImageHeight "$file" \
	| fgrep -v Orientation | cut -d , -f 2-4 \
	| awk -F , '{ if ($1 ~ /^[68]$/) { print $3 " " $2 }
	else { print $2 " " $3 } }' \
	| xargs printf 'width="%s" height="%s"'
}


echo '<p>'
echo

for img in $*
do
	resized="`echo \"$img\" | sed 's|\.|-resized.|'`"
	
	convert "$img" -resize 375x "$resized"
	
	cat <<- eof
	<a href="$img">
	<img src="$resized" alt="$resized"
	`_size "$resized"` fetchpriority="high">
	</a>
	
	eof
done

echo '</p>'
created [1784281599] 2026-07-17 12:46:39 +0300/EEST, modified [1784283442] 2026-07-17 13:17:22 +0300/EEST