Any way to print exif-values with surrounding '"'?

Started by tps800, December 26, 2018, 05:33:23 AM

Previous topic - Next topic

tps800

If I execute exiftool -exif:Make -exif:Model -exif:FocalLength -exif:ExposureTime -exif:ISO -exif:LightSource -exif:LensModel -common_args -s3  k-20181224-170120-000_tps.jpg I#ll get:

SONY
ILCE-9
30.0 mm
1/640
250
Daylight
15-30mm F2.8 SSM


Any way to have it print

"SONY"
"ILCE-9"
"30.0 mm"
"1/640"
"250"
"Daylight"
"15-30mm F2.8 SSM"


I could not find any option or something like that to add '"'.

StarGeek

You can use the -api Filter option.  On Windows CMD, you would add -api "filter=s/^|$/\"/g" or -api "filter=s/^|$/"""/g" as the double quote needs to be escaped.  On linux/Mac, I think it would be -api 'filter=s/^|$/"/g'.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

tps800

Yes, that works, but it does not help to push output to single bash variables to print them as needed.

What I'd like to have is
exiftool \
  -exif:Make \
  -exif:Model \
  -exif:FocalLength \
  -exif:ExposureTime \
  -exif:ISO \
  -exif:LightSource \
  -exif:LensModel \
  -common_args -s3  k-20181224-170120-000_tps.jpg


this gives:
SONY
ILCE-9
30.0 mm
1/640
250
Daylight
15-30mm F2.8 SSM


Now any idea how to have that formated:
SONY ILCE-9 • 30.0mm • 1/640s • 250iso • Daylight
Lens: 15-30mm F2.8 SSM


Any hint where I could start would be nice!

StarGeek

Take a look at the -p option.

exiftool -p "$exif:Make $exif:Model • $exif:FocalLength • $exif:ExposureTime • $exif:ISO • $exif:LightSource$/Lens: $exif:LensModel" k-20181224-170120-000_tps.jpg

The -Common_Args option in your command isn't needed.  It doesn't do anything except in conjunction with the -execute option.

See FAQ #21 for details on the $/ in the above command
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).