is it possible to list all images in a directory that have pixel size grater or smaller than x? I found this command on another thread
find . -name '*.png' -exec file {} \; | sed 's/\(.*png\): .* \([0-9]* x [0-9]*\).*/\2 \1/' | awk 'int($1) < 250 {print}'
this command works well for *.png, but the moment I change it to *.jpg the results get too crazy. see below. I would like to write the results to a log file so that I can later delete these images from my product catalog.
*.png output
50 x 50 ./data/catalog/agsquare.png
220 x 138 ./data/catalog/brickwall_@2X.png
3 x 3 ./data/catalog/dots.png
98 x 98 ./data/catalog/grid-noise.png
*jpg output (the pixel size is ignored, something is clearly wrong with this command)
./data/background/fashion-shirt.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 1920x1440, frames 3
./data/background/grey-bag.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 1920x1280, frames 3
OS: Ubuntu 18.04.5 LTS