Created
June 4, 2021 03:56
-
-
Save y56/67f283c90a0bf3b375aa40f5857c0c6b to your computer and use it in GitHub Desktop.
[shell] compare image height and width, and then do sth
This file contains hidden or 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
for f in *.png; | |
do | |
if [ $(file "$f" | cut -d ',' -f2 | cut -d ' ' -f2) -gt $(file "$f" | cut -d ',' -f2 | cut -d ' ' -f4) ] | |
then | |
echo "width > height" | |
else | |
echo "width < height" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment