ExifTool Forum

ExifTool => Newbies => Topic started by: LKS5 on September 24, 2016, 12:59:20 PM

Title: Writing to Aftershot Pro XMP sidecar
Post by: LKS5 on September 24, 2016, 12:59:20 PM
I am doing timelapse photography using Corel's AfterShot Pro for post processing. I would like to make whitebalance and exposure adjustments of varying magnitude over the set of pictures. I'm new to Exiftool, but was able to find and read the proprietary Bibble tags in the XMP sidecar file that contains the changes to the photos I selected as keyframes. I imported  the tag values for all the photos into MS Excel where I applied math corrections to smooth out the changes to the tagged values for intermediate photos. I now have a list of whitebalance and exposure adjustments for all the photos that I'd like to write back into the XMP sidecar files. I've tried writing back directly to these XMP files and get a warning returned that the tag does not exist.  I've exhausted my shallow knowledge base and could not find an example that helped. Any help would be appreciated. 

For RowCount = 2 To LastRow
    Exposure = Worksheets("analysis").Range("Q" & RowCount)
    Kelvin = Worksheets("analysis").Range("M" & RowCount)
    OutFile = Worksheets("importxmp").Range("A" & RowCount)
    strCmdXMPOUT = "exiftool -xmp:VersionsSettingsLayersOptionsExposureval=" & Exposure & " -xmp:VersionsSettingsLayersOptionsCkelvin=" & Kelvin _
    & " -xmp:VersionsSettingsLayersOptionsKelvin=" & Kelvin & " " & OutFile
    If Not bShellAndWait("cmd.exe /S /c" & strCmdXMPOUT, vbNormalFocus) Then Err.Raise 9999
Next
Title: Re: Writing to Aftershot Pro XMP sidecar
Post by: Phil Harvey on September 24, 2016, 08:54:07 PM
From the tag name it sounds like it might be in an XMP structure, which would complicate things.  To write an XMP tag, it must be known to ExifTool.  Since Bibble tags aren't, you must create user-defined tags to write them.  The sample config file (https://exiftool.org/config.html) gives examples of how to do this, but if structures are involve you may need some guidance.  If you could post the raw XMP I could help more (ie. the output of this command: exiftool -xmp -b FILE > out.xmp)

- Phil
Title: Re: Writing to Aftershot Pro XMP sidecar
Post by: LKS5 on September 24, 2016, 11:25:54 PM
Phil,
Thank you so much for helping with this issue. Attached is the output xmp file. I'm digesting the sample config file in the mean time.
Title: Re: Writing to Aftershot Pro XMP sidecar
Post by: Phil Harvey on September 25, 2016, 11:34:18 AM
As I thought, things are complicated here because the tags are in a list of structures.  And wow, there are a lot of them.  I can help with the user-defined tags when I get more time, but writing them can also be tricky if there is more than one structure in the list (which luckily there isn't in your sample).

So I think you will be able to do what you want, but I wouldn't recommend trying to build the necessary user-defined tags since this will be difficult.  I'll help you with that.

- Phil
Title: Re: Writing to Aftershot Pro XMP sidecar
Post by: LKS5 on September 25, 2016, 12:24:41 PM
Thanks Phil. I really appreciate the help. I tried an initial interpretation of the config information and came up with the following, which was rejected by Exiftool.

For RowCount = 2 To 4
    Exposure = Worksheets("analysis").Range("Q" & RowCount)
    Kelvin = Worksheets("analysis").Range("M" & RowCount)
    OutFile = Worksheets("importxmp").Range("A" & RowCount)
    strCmdXMPOUT = "%Image::ExifTool::UserDefined::dmf = ('Image::ExifTool::XMP::xmp' => {" & _
                        "GROUPS => {1 => 'XMP-dmf'}," & _
                        "VersionsSettingsLayersOptionsCkelvin => { }, " & _
                        "VersionsSettingsLayersOptionsKelvin => { }, " & _
                        "VersionsSettingsLayersOptionsExposureval => { }}}" & _
    "exiftool -xmp:VersionsSettingsLayersOptionsExposureval=" & Exposure & " -VersionsSettingsLayersOptionsCkelvin=" & Kelvin _
    & " -VersionsSettingsLayersOptionsKelvin=" & Kelvin & " " & OutFile
    If Not bShellAndWait("cmd.exe /S /k" & strCmdXMPOUT, vbNormalFocus) Then Err.Raise 9999
   
    Next
Title: Re: Writing to Aftershot Pro XMP sidecar
Post by: Phil Harvey on September 25, 2016, 09:19:16 PM
OK, attached is a config file that will allow you to write any/all of the Bibble tags in the sample you posted.  I haven't bothered trying to clean up the tag names at all, with the exception that I have changed all of the tag names from "Versions..." to "DMF..." since "Versions" doesn't make much sense.

With this change and the attached config file, your line of code would look like this:

"exiftool -config PATH_TO_CONFIG_FILE/bibble.config -DMFSettingsLayersOptionsExposureval=" & Exposure & " -DMFSettingsLayersOptionsCkelvin=" & Kelvin _
    & " -DMFSettingsLayersOptionsKelvin=" & Kelvin & " " & OutFile


- Phil
Title: Re: Writing to Aftershot Pro XMP sidecar
Post by: Phil Harvey on September 26, 2016, 08:35:33 AM
I was playing with this file and noticed a problem.  ExifTool still can't write any of the structure fields that have a dot (.) in their tag ID.  This problem will be fixed in ExifTool 10.28.  Luckily none of the tags you are writing (so far) have dots in their ID's, so you should be OK (for now).

- Phil
Title: Re: Writing to Aftershot Pro XMP sidecar
Post by: LKS5 on September 27, 2016, 02:25:10 AM
Phil,
That did the trick. Thank you very much for your time and effort.