Closed hutcheon closed 9 years ago
so there are a few issues with this patch. On mac at least the -a operator has problems, which is why I use the
if [ foo ] && [ bar ]
form for conditionals.
Also the result from
identify -format "%[EXIF:Orientation]" "$image"
may not return anything at all if there is no exif data. And the default orientation is not limited to 1. I think here we want to whitelist specific vertical codes - 5, 6, 7, 8 to swap width and height values
aside from that, I think this is a great way to resolve the autorotation issue.
Interesting, I didn't know bash on Mac differed. Good idea on the exif vertical orientation codes, for the life of me I couldn’t find a good list.
almost there! There's a typo in one of the orientation conditionals (-n $orienation) also I'd wrap $orientation in quotes just in case
Oh man, I'm on the ball today :( Fixed the typo. Though I already had the quotes.
Optional image auto-rotation. Properly accounts for the rotation in the dimensions sent to the templates.