Created
August 17, 2019 08:21
-
-
Save mitsu-ksgr/fc59f24a6989fbb172bbae2b690110f7 to your computer and use it in GitHub Desktop.
get image size in shellscript
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
#!/bin/bash | |
# require: image magick | |
file_path="/path/to/image.png" | |
size=$(identify -format "%w,%h" $file_path) | |
w=${size%,*} | |
h=%{size##*,} | |
echo "$file_path: $w x $h" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment