#!/bin/sh USAGE='Usage: brewinfo Returns the most relevant EXIF-metatags. Depends on exiftool. Copyright © Daniel Ljunggren . Nov 2010. ' while [ $# -gt 0 ] do case "$1" in -*) echo $USAGE 1>&2 exit 1 ;; *) break ;; esac shift 1 done for FILE do if [ -r "$FILE" ]; then case "$FILE" in *.raw) TYPE=image; ;; *.RAW) TYPE=image; ;; *.crw) TYPE=image; ;; *.CRW) TYPE=image; ;; *.cr2) TYPE=image; ;; *.CR2) TYPE=image; ;; *.jpg) TYPE=image; ;; *.jpeg) TYPE=image; ;; *.JPG) TYPE=image; ;; *.JPEG) TYPE=image; ;; *.png) TYPE=image; ;; *.PNG) TYPE=image; ;; *.gif) TYPE=image; ;; *.GIF) TYPE=image; ;; *.tif) TYPE=image; ;; *.tiff) TYPE=image; ;; *.TIF) TYPE=image; ;; *.TIFF) TYPE=image; ;; *.xcf) TYPE=image; ;; *.XCF) TYPE=image; ;; *.pef) TYPE=image; ;; *.PEF) TYPE=image; ;; *.mov) TYPE=video; ;; *.MOV) TYPE=video; ;; *.mod) TYPE=video; ;; *.MOD) TYPE=video; ;; *.mp4) TYPE=video; ;; *.MP4) TYPE=video; ;; *.avi) TYPE=video; ;; *.AVI) TYPE=video; ;; *) echo "Can't handle file '$FILE', only raw, JPEG, PNG, XCF, GIF or TIFF are valid files, skipping" 1>&2 continue ;; esac if [ $TYPE == "image" ]; then exiftool -g -FileName -DocumentName -OwnerName -XMP:Author -Artist -Copyright -XMP:Copyright -ProcessingSoftware -Software \ -DateTimeOriginal -FileModifyDate -ImageSize -Xresolution -YResolution \ -BitsPerSample -Orientation -ProfileDescription -Model -Lens -FocalLength -Flash \ -ISO -MeasuredEV -ExposureCompensation -FlashExposureComp -ExposureTime \ -ApertureValue -XMP:Title -XMP:Description -ImageDescription -IPTC:ObjectName -IPTC:Caption-Abstract -UserComment -Comment -Keywords -f "${FILE}" echo "" elif [ $TYPE == "video" ]; then exiftool -g -FileName -DocumentName -OwnerName -XMP:Author -Artist -Copyright -XMP:Copyright -ProcessingSoftware -Software \ -MajorBrand -DateTimeOriginal -FileModifyDate -Duration -ImageSize -Xresolution -YResolution \ -BitsPerSample -Orientation -ProfileDescription -Model -Lens -FocalLength -Flash \ -CameraISO -AutoISO -MeasuredEV -ExposureCompensation -FlashExposureComp -ExposureTime \ -ApertureValue -XMP:Title -XMP:Description -ImageDescription -IPTC:ObjectName -IPTC:Caption-Abstract -UserComment -Comment -Keywords -f "${FILE}" echo "" fi fi done