ExifTool Forum

ExifTool => Developers => Topic started by: QPRJohn on October 21, 2014, 02:57:22 PM

Title: Tags "go missing" when writing tags to many image files from XMP files
Post by: QPRJohn on October 21, 2014, 02:57:22 PM
I hope I have described my problem in enough detail:-

Using ExifToolIO.dll, I have code that will, using the -tagsfromfile argument, copy tags from an XMP file to images being transferred to a hard drive from a CF Card. I have noticed that several Tags "go missing" when I view the images in Photo Mechanic several tags are not shown. (when I "read" the same images using exiftool all the tags are found?)


The method I use to produce the "XMP" files is by using arguments similar to the following: -

" -CaptionWriter="Caption details here" -Writer-Editor="Caption details here"  "G\XMP\lastXMP.xmp"

When I "read" the "lastXMP.xmp" file to extract the tags to populate my form's textboxes, this works perfectly each time. If I use the same code writing to an image, that also works fine.

Should I use the following to produce an "xml" file. Then use the "xml" file for the "-tagsfromfile" source?

exiftool a.jpg -X > a.xml

Has anyone else had this problem?

I'm using VB.Net (Visual Studio 2010 Professional) on Windows 7 Professional.

Thanks John
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: Phil Harvey on October 21, 2014, 05:35:06 PM
I suspect that your problem may be touched on in the last paragraph of FAQ number 3 (https://exiftool.org/faq.html#Q3).  You must be careful when mixing IPTC and XMP tags.  Writer-Editor is IPTC, but CaptionWriter is XMP.

- Phil
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: QPRJohn on October 22, 2014, 01:24:25 AM
I'm aware of the various IPTC, XMP and EXIF tags sharing the same information.

To find the tags I was producing the metadata in each application (Photoshop & Photo Mechanic) reading them with Exiftool to get the tags names and then build the argument string including each of the IPTC, XMP and EXIF tags. EG:-



        strExifArg = strExifArg & " -Exif:Copyright=""" + Copyright + Chr(34)
        strExifArg = strExifArg & " -XMP-dc:rights=""" + Copyright + Chr(34)
        strExifArg = strExifArg & " -CopyrightNotice=""" + Copyright + Chr(34)



In the case above would I modify it to:-



strExifArg = strExifArg & " -MWG:Copyright=""" + Copyright + Chr(34)



When I read the same tags from an image I do the same thing by reading each tag.

-John
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: Phil Harvey on October 22, 2014, 07:37:59 AM
Hi John,

My thought was that perhaps you need to update IPTCDigest, because have seen some applications ignore some XMP when this isn't done.  But I can't say whether or not PhotoMechanic cares about this.  I think maybe this question is better asked in a PhotoMechanic forum.  Also, more details about which tags go missing would be helpful.

- Phil
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: QPRJohn on October 23, 2014, 08:28:12 AM
Hi Phil

Thanks for the reply.

To clarify, is the IPTCDigest done when writing the "MWG:" tags?

I'm not by my own PC at the moment, I'll list the tags that are "missing" later.

This only happens when I'm using -tagsfromfile, where the tags are taken from an XMP file and transferred to a JPG file that is straight from the camera.

Thanks John
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: Phil Harvey on October 23, 2014, 10:13:02 AM
IPTCDigest is only written automatically with the MWG tags.  Otherwise you need to update it yourself.

It doesn't matter where the information came from.  The only important thing is what was written.

- Phil
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: QPRJohn on October 24, 2014, 10:49:57 AM
Hi Phil

I've tried several different things, one being producing an XMP using my app (with Exiftool), then using the same XMP transferring images from a card to my PC using Adobe Bridge, Photo Mechanic and my app. Not sure if this is correct but I included the the following tag " -LegacyIPTCDigest=askjgd0987sfa0978f" ?

After transferring the metadata to images using Adobe Bridge & Photo Mechanic, all the metadata can be seen in all three apps.

When I use my app to transfer the images the metadata can be seen in my app and Photoshop, there are quite a few tags not showing in Photo Mechanic. Photo Mechanic has two options, 1 Read embedded XMP before IPTC, 2. Read embedded IPTC before XMP, (default is read XMP first) when I swap this option I can see most of the missing tags but others then go missing?

I have attached a copy of the xmp.

Any ideas?

-John

Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: QPRJohn on October 24, 2014, 12:41:27 PM
List of Missing Tags

Photomechanic set to read XMP first (Default)

-Headline

-IPTC:Credit
-IPTC:Source

-XMP-iptcExt:Event
-XMP:Event

-MWG:City

-EditStatus
-Category

-SupplementalCategories
-Urgency


Photomechanic set to read IPTC first

-xmp:Description
-ImageDescription
-Caption-Abstract
Replacing the three above with -MWG:Description makes no difference

-CaptionWriter
-Writer-Editor

-XMP-xmp:keywords
-XMP-dc:subject=
Replacing the two above with -MWG:Keywords= makes no difference


-XMP-dc:Creator
-By-line
Replacing the two above with -MWG:Creator makes no difference

-By-lineTitle
-AuthorsPosition

-XMP-dc:rights
-CopyrightNotice
Replacing the two above with -MWG:Copyright makes no difference


-XMP-iptcExt:Event
-XMP:Event

-Sub-location
-Location
Replacing the two above with -MWG:Location makes no difference

-State
-Province-State
Replacing the two above with -MWG:State makes no difference

-Country
-Country-PrimaryLocationName
Replacing the two above with -MWG:Country makes no difference

-Country-PrimaryLocationCode
-CountryCode

-Title
-ObjectName

-TransmissionReference
       
-OriginalTransmissionReference

-Instructions
-SpecialInstructions

Thanks

-John

Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: QPRJohn on October 24, 2014, 12:56:09 PM
Additional information - I used the -tagsfromfile option in my app and copied from one jpeg to another and no tags are missing?
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: Phil Harvey on October 24, 2014, 09:12:18 PM
It seems like it ignores just about everything (including many IPTC tags) when set to read IPTC first.

I don't understand what you mean by "replacing with -MWG:xxx".  The ExifTool MWG tags are composite tags based on the value of the corresponding EXIF, IPTC and XMP tags.  They are not a physically different tag.

I think you need to go to a PhotoMechanic forum to understand what their software is doing.

Again, if possible try writing one of these "missing" tags using PhotoMechanic, then use ExifTool to see what changed. (a-la faq 3)


- Phil
Title: Re: Tags "go missing" when writing tags to many image files from XMP files
Post by: Hayo Baan on October 25, 2014, 02:57:18 AM
I think I can help here as I have fair understanding of what PM does and how it works. First of all, as IPTC simply contains less data than XMP, keep your PM preferences to read XMP before IPTC. Note though that if PM found XMP tags, the IPTC info is no longer taken into account (heck, you told it to use the XMP)! Unless you explicitly copy data into both the XMP and IPTC counterpart tags with exiftool, they will not show up at both locations (PM does this for you when you update metadata there). MWG does take care of some of the tags for you here, but not all. This might explain why you don't see all tags present.

If you post a sample file and a list of metadata you require to be present, I'm sure I can help you with the commands to use to get the results you're after.