I started moving away from Lightroom to Mylio. I want to keep my options and be able to go back to Lightroom (or to an unknown photo app) down the road. I want to make sure all my edits/tagging in Mylio doesn't get locked into the app. Mylio uses XMP sidecars but it looks like LR ignores them on import (even after explicitly "Read metadata from file"). I was thinking I could use EXIFTOOL to copy all the metadata into the JPEGs. Here's the XML that mylio generates, what's the right way to embed this in the JPEG so that LR will read them?
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.6.0">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:exif="http://ns.adobe.com/exif/1.0/"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:MY="http://ns.mylollc.com/MyloEdit/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
exif:DateTimeOriginal="2019-11-07T17:01:43.461Z"
exif:SubSecTime="461"
exif:SubSecTimeOriginal="461"
exif:SubSecTimeDigitized="461"
exif:GPSVersionID="2.2.0.0"
exif:GPSLatitude="28,28.4000N"
exif:GPSLongitude="81,28.0298W"
xmp:CreateDate="2019-11-07T17:01:43.461Z"
xmp:ModifyDate="2019-11-07T17:01:43.461Z"
xmp:Rating="5"
xmp:MetadataDate="2019-12-14T01:01:47.941Z"
xmp:Label="Red"
MY:DateRangeStart="2019-11-07T17:01:43.461Z"
MY:DateRangeEnd="2019-11-07T17:01:43.461Z"
MY:DateRangeScope=""
MY:Undated="false"
MY:flag="true"
MY:processVersion="1"
MY:MetadataDate="2019-12-14T01:01:47.941Z"
MY:vibrance="0.650000"
MY:saturation="-1.000000"
MY:cropTop="0.000000"
MY:cropLeft="0.265878"
MY:cropHeight="1.000000"
MY:cropAspect="2.647662"
MY:cropEnabled="true"
MY:cropConstraint="0"
MY:cropConstraintWidth="1"
MY:cropConstraintHeight="1"
MY:contrast="1.056700"
xmpMM:DocumentID="9A15142E-3A11-4CB4-8693-1EB3DB80A150"
xmpMM:OriginalDocumentID="9A15142E-3A11-4CB4-8693-1EB3DB80A150"
xmpMM:InstanceID="xmp.iid:4DF974E9-A66A-487C-A1EA-8F92F1969373">
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default">ThisIsTitle</rdf:li>
</rdf:Alt>
</dc:title>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">ThisIsCaption</rdf:li>
</rdf:Alt>
</dc:description>
<dc:rights>
<rdf:Alt>
<rdf:li xml:lang="x-default">ThisIsCopyright</rdf:li>
</rdf:Alt>
</dc:rights>
<dc:subject>
<rdf:Bag>
<rdf:li>Keyword1</rdf:li>
<rdf:li>Keyword2</rdf:li>
</rdf:Bag>
</dc:subject>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
I would think your problem is not so much getting the edit metadata into the jpeg as converting to tags and formats that LR understands.
As a simple example you have MY:vibrance="0.650000" an LR file I looked at had XMP-crs:Vibrance="+20"
Hmmm good point. How about if I stick with the metadata which should be easier to copy strings from one property to another. Specifically these tags:
xmp:Rating="5"
xmp:Label="Red"
MY:flag="true"
dc:title
dc:description
dc:subject (which looks like Myio treats as Keyword property)
Quote from: winterminute on December 18, 2019, 12:34:30 AMdc:subject (which looks like Myio treats as Keyword property)
Yes, subject is the XMP version of Keywords.
I can't really speak as to why there would be a problem, but you could try simply copying all the xmp data directly to the jpg. Assuming the XMP files are in the same directory
exiftool -ext jpg -TagsFromFile %d%f.xmp -all:all /path/to/jpgs
Great, thank you. This works for the most part, 2 remaining issues:
1) The flag status is saved in a proprietary tag: MY:flag="true". Is there a way I can map from 1 prop to another?
2) When you tag a person in Lightroom, it also populates the Keywords property so I want to replicate that behavior. The "Iptc4xmpExt:PersonInImage" contains the list of people so seems like the right property to use. I'm not sure if LR looks at XMP:Subject or IPTC:Keywords.
Quote from: winterminute on December 20, 2019, 03:42:07 AM
1) The flag status is saved in a proprietary tag: MY:flag="true". Is there a way I can map from 1 prop to another?
Yes, add something like this after
-all:all in the command:
"-TAG<flag"Quote2) When you tag a person in Lightroom, it also populates the Keywords property so I want to replicate that behavior. The "Iptc4xmpExt:PersonInImage" contains the list of people so seems like the right property to use. I'm not sure if LR looks at XMP:Subject or IPTC:Keywords.
You could add this:
"-keywords+<personinimage" "-subject+<personinimage"I used
+< instead of
< to add to existing keywords in the destination JPG file. But if the source XMP already contains a Subject then this will override that, but you can change this by using
-addtagsfromfile instead of
-tagsfromfile.
- Phil
I'm getting the following error: "The system cannot find the file specified". If I run it without the Subject param then it works and does copies over some metadata so I know it can find the JPEG and the XMP file. But trying to append to the Subject (or Keywords) fails with can't find the file error.
Here's the simplified command I'm using for troubleshooting
D:\ExifTest>exiftool -TagsFromFile %d%f.xmp D:\ExifTest\MylioImage.jpg -subject+<personinimage
Also, how does EXIFTOOL serialize items from an array. PersonInImage looks like this in the XMP file. LR needs them to be comma separated values.
<Iptc4xmpExt:PersonInImage>
<rdf:Seq>
<rdf:li>Person1</rdf:li>
<rdf:li>Person2</rdf:li>
<rdf:li>Person3</rdf:li>
</rdf:Seq>
</Iptc4xmpExt:PersonInImage>
Also quick update on my other goal, after some research, I learned LR doesn't write or read "Flag" from any kind of metadata. It seems they keep this proprietary which of all the metadata seems the least interesting for them to not handle interop.
Quote from: winterminute on December 22, 2019, 06:18:57 PM
I'm getting the following error: "The system cannot find the file specified". If I run it without the Subject param then it works and does copies over some metadata so I know it can find the JPEG and the XMP file. But trying to append to the Subject (or Keywords) fails with can't find the file error.
D:\ExifTest>exiftool -TagsFromFile %d%f.xmp D:\ExifTest\MylioImage.jpg -subject+<personinimage
Quotes are needed around any argument that has a greater/less than symbol, i.e. tag copy commands. This is to prevent shell file redirection.
QuoteAlso, how does EXIFTOOL serialize items from an array. PersonInImage looks like this in the XMP file. LR needs them to be comma separated values.
No it doesn't.
PersonInImage is what is called a List Type tag. Each item in the list is completely separated from the others as you see in the XMP. Lightroom just displays it as a comma separated list for ease of editing. You'll find a similar situation with keywords, which is saved into the
XMP:Subject tag.
I think what you're saying is the serialization happens as part of the EXIFTOOL writing to the console but the embedded metadata retains the data structure which makes perfect sense. I got an error but everything seemed to get written to the JPG correctly.
Error: Warning: Shift value for XMP-xmp:Keywords is not a number
For anyone else who finds this thread, this is the cmd I'm using:
exiftool -ext jpg -TagsFromFile %d%f.xmp "D:\RootDir" -all:all "-keywords+<personinimage" "-subject+<personinimage" -overwrite_original
I've verified that the changes I make in MYLIO (which handles automatically generating/writing an XMP file) and are merged into the JPEG and that LR reads them correctly.
Thanks a lot for all your help Stargeek and Phil. This tool never ceases to amaze me.
Quote from: winterminute on December 23, 2019, 03:17:03 AM
Error: Warning: Shift value for XMP-xmp:Keywords is not a number
Right. XMP-xmp:Keywords is not a List-type tag, so the "+" is interpreted as a numerical shift. The warning indicates that this tag is not written (which is fine, because you didn't want to write XMP-xmp:Keywords anyway.) I don't why you are seeing this warning unless you are using the
-v option, but you can change "
-keywords" to "
-IPTC:Keywords" to avoid this.
- Phil