libexif / exif

A small command-line utility to show EXIF information hidden in JPEG files
GNU Lesser General Public License v2.1
55 stars 22 forks source link

How to output only the value of the tag? #3

Closed Nexxkinn closed 4 years ago

Nexxkinn commented 4 years ago

I was writing a script to organise downloaded pictures and camera picture by reading LensMake tag. Currently, I'm using this command to get the value of the tag

exif IMG_0120.JPG -t 0xa433 2> /dev/null | awk '/Value:/ {print $2}'

Is there any way to get the value of it without usik awk, since it's pretty trivial to only get the value of it by command and I can't see any command parameters required to set it on.

dfandrich commented 4 years ago

You can basically do that with the -m (--machine-readable) option, but that adds a newline character (which shouldn't matter in your case). I have in my personal to-do list adding a --save-raw command that would write the raw tag data (without the newline) into the --output file but I haven't gotten around to implementing that.

Nexxkinn commented 4 years ago

Ah, I see. Exactly what I've been looking for. Thanks.