Skip to content

Instantly share code, notes, and snippets.

@hoolymama
Created July 4, 2013 22:41
Show Gist options
  • Save hoolymama/5930650 to your computer and use it in GitHub Desktop.
Save hoolymama/5930650 to your computer and use it in GitHub Desktop.
process output from itstat (sony)
# "ls *.JPG | itstat" gives the following output:
#
# File: DSCN0159.JPG
# Resolution: 2560 x 1920
# Channels: 10
# Channel Types: RGB with Alpha
# Bit Depth: 8
#
# File: DSCN0160.JPG
# Resolution: 2560 x 1920
# Channels: 10
# Channel Types: RGB with Alpha
# Bit Depth: 8
#
# File: DSCN0161.JPG
# Resolution: 1920 x 2560
# Channels: 10
# Channel Types: RGB with Alpha
# Bit Depth: 8
#
# We want a comand that will use itstat and list files that are a specific resolution like so:
#
# DSCN0159.JPG: 2560 x 1920
# DSCN0160.JPG: 2560 x 1920
#
# The command is:
res="2560 x 1920" && ls *.JPG | itstat.py | grep -B 1 "$res" | grep "File:" | sed "s/$/: $res/" | sed 's/File: //'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment