Skip to content

Instantly share code, notes, and snippets.

@Juul
Created October 16, 2021 08:45
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 Juul/6bb4c6b0a079fe155cf551657eeac0ed to your computer and use it in GitHub Desktop.
Save Juul/6bb4c6b0a079fe155cf551657eeac0ed to your computer and use it in GitHub Desktop.
Anamorphic desqueeze photos
#!/bin/bash
# It appears my anamorphic lens is closer to 140% than the 133% is says on the label
# TODO Have an argument to force orientation since the identify command seems to not always work
echo "Creating directory: desqueezed/"
mkdir -p desqueezed
for f in `find -maxdepth 1 -iname "*.jpg" -o -iname "*.jpeg"`; do
echo "De-squeezing: $f"
ORIENT=$(identify -format "%[orientation]" $f)
if [ "$ORIENT" == "LeftBottom" ]; then
# taller than it is wide
convert -resize 100%x140% $f desqueezed/$f
else
# wider than it is tall
convert -resize 140%x100% -auto-orient $f desqueezed/$f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment