Created
November 11, 2016 12:27
-
-
Save valchonedelchev/d2acf07a339a00dfd5328a570c3544fe to your computer and use it in GitHub Desktop.
Detect image orientation based on image size and prints it out
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 | |
# File: /usr/bin/local/image-orientation | |
test=$(convert $1 -format "%[fx:(w/h>1)?1:0]" info:) | |
if [ $test -eq 1 ]; then | |
echo horizontal | |
else | |
echo vertical | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment