Author Topic: Editing multiple value tags  (Read 1537 times)

bogdan

  • Newbie
  • *
  • Posts: 2
Editing multiple value tags
« on: July 16, 2014, 03:25:13 AM »
Hello,

I am having problems figuring out the command line syntax to change tags that have multiple values (tag count is > 1)

Say I have a DNG file for which:

exiftool.exe  -a -G1 -s rotated.dng

reports
Code: [Select]
[SubIFD]        DefaultCropSize                 : 1280 720

and I want to change it to:
Code: [Select]
[SubIFD]        DefaultCropSize                 : 720 1280

This sounds like a basic task, but still I wasn't able to find any example/documentation how to do it.

Here's what I thought would work, but didn't:


exiftool.exe -SubIFD:DefaultCropSize=720 -SubIFD:DefaultCropSize+=1280 rotated.dng
Warning: Not enough values specified (2 required) for SubIFD:DefaultCropSize
Warning: Can't shift DefaultCropSize (not a number) - rotated.dng
    0 image files updated
    1 image files unchanged

exiftool.exe -sep "_" -SubIFD:DefaultCropSize=720_1280 rotated.dng
Warning: Not enough values specified (2 required) for SubIFD:DefaultCropSize
Nothing to do.

exiftool.exe -SubIFD:DefaultCropSize=720 -SubIFD:DefaultCropSize=1280 rotated.dng
Warning: Not enough values specified (2 required) for SubIFD:DefaultCropSize
Warning: Not enough values specified (2 required) for SubIFD:DefaultCropSize
Nothing to do.


Thank you for an amazing tool!

Hayo Baan

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 1140
  • Professional Photographer & Software Developer
    • Hayo Baan – Photography
Re: Editing multiple value tags
« Reply #1 on: July 16, 2014, 04:40:31 AM »
Hi Bogdan,

You simply need to provide the two values as one string:
Code: [Select]
exiftool -DefaultCropSize="720 1280" rotated.dngBut there's an even better method that doesn't require you to type the values:
Code: [Select]
exiftool "-DefaultCropSize<${DefaultCropSize;s/(\d+) (\d+)/$2 $1/}" rotated.dng(on a mac, use single quotes)

Hope this helps,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl

bogdan

  • Newbie
  • *
  • Posts: 2
Re: Editing multiple value tags
« Reply #2 on: July 16, 2014, 06:43:53 AM »
Thanks, it worked like a charm.

PS: I wonder why I haven't been able to dig this out from the documentation...