Created
January 3, 2024 15:17
-
-
Save mikedigriz/1055ba7436b1c553daaa31bf01040476 to your computer and use it in GitHub Desktop.
move images with width less than 1600, or 1080p to dir
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
## | |
# move 1080p images to folder | |
# read first script (move_low_res_img.sh) for fix issues | |
## | |
#!/bin/bash | |
shopt -s nullglob | |
for fname in *.jpg *.png *.gif | |
do | |
read width height < <(exiv2 "$fname" 2>&1 | awk '/^Размер изображения/{print $3,$5}') | |
[ "$width" ] || continue | |
[ "$width" -eq 1920 ] && [ "$height" -eq 1080 ] && mv "$fname" /home/yourdir/1080p | |
done |
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
## | |
# apt-get install exiv2 | |
# in Russian lang exiv2 output: Image size = Размер изображения | |
# check output for your file: exiv2 image.jpg 2>&1 | awk '/^Размер изображения/{print $3,$5}' | |
## | |
#!/bin/bash | |
shopt -s nullglob | |
for fname in *.jpg *.png *.gif | |
do | |
read width height < <(exiv2 "$fname" 2>&1 | awk '/^Размер изображения/{print $3,$5}') | |
[ "$width" ] || continue | |
[ "$width" -lt 1600 ] && mv "$fname" /home/yourdir/bad/ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for rename files in dir to 1.jpg, 2.png, 3.jpg see