Last active
December 22, 2015 04:39
-
-
Save shoota/6418583 to your computer and use it in GitHub Desktop.
Dropboxから同期したJPG画像のピクセル幅、ピクセル高さを取得して、一致したら出力する。ファイル名に半角スペースがあるので、IFSをセットしてidentifyに投げる。identifyを使うためにはImageMagicをインストールする必要がある。
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 | |
files=`find ~/Dropbox/カメラアップロード -type f | grep \.jpg` | |
( | |
## set delimiter | |
IFS=$'\n'; | |
for i in ${files}; do | |
width=`identify -format "%w" ${i}` | |
height=`identify -format "%h" ${i}` | |
#echo "${i} w: ${w} h: ${h}" | |
if [ ${width} = ${height} ]; then | |
echo "equal" | |
echo "${i} w: ${width} h: ${height}" | |
fi | |
done | |
) | |
echo "done ps." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment