Created
October 16, 2021 08:45
-
-
Save Juul/6bb4c6b0a079fe155cf551657eeac0ed to your computer and use it in GitHub Desktop.
Anamorphic desqueeze photos
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/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