-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metadata: Embed XMP metadata in JPEG files #243
Comments
Thanks for your feedback! This absolutely makes sense. We import information from EXIF and also XMP to a certain extend. Would be good to know what fields are actually used (could be "description", but XMP also has a DC title field that Lightroom uses). We should also add a "keywords" field in our database (need to figure out what EXIF/XMP field this is as well). |
I loaded the picture of the ladybug into the tool "Get IPTC Photo Metadata" from the IPTC organisation. The relevant XMP fields are "title" and "keywords". If title could be loaded into photoprism's title field that would be of great help. At the moment a reindexing overwrites the title which is not what the user want's once the title has been manually updated. With the keywords used as labels I assume you can improve the tagging a lot. The system could learn from imported pictures. In another thread I saw a discussion regarding face regocgnition. Let's assume the keyword field already includes the name of the person....... |
Not difficult to implement, let's do this. Also need the keywords field for words extracted from file names so that the user can see and edit them. Thanks for the test files! |
We currently don't index Exif.Image.XPTitle and other fields starting with XP, probably because this is not included in the base standard @dsoprea? |
Added: Subject, Keywords, Comment, CameraOwner and CameraSerial Todo: Read values from Exif.Image.XPTitle, XPSubject, XPKeywords,... Signed-off-by: Michael Mayer <michael@liquidbytes.net>
Added a test for this. Hope it was OK to use the Ladybug as example image! |
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
Need to get ready for our journey now, hope this will do for now. Code is prepared to index additional Exif fields once we get them from our |
Sure, please! |
How does the EXIF parsing depend on the 'meta' package: "is prepared to index additional Exif fields once we get them from our meta package."? Is it some kind of dynamic binding defined in the DB? |
Non-standard stuff can be indexed. We preload the standard tags at the top of the process, but can readily add more. |
We parse it there using your Exif library so that our indexer can read from the Data struct, independent where the data came from. |
That's what I thought but failed to figure out how yesterday... Do you have an example or can send a PR for our meta package? |
I was in the car at the time. I had forgotten that this was the name of the package that hosts go-exif. It'd be here: photoprism/internal/meta/exif.go Line 77 in c13e39e You'd insert something like:
Let me know if you want me to help. |
<- Note that you'll have to import github.com/dsoprea/go-exif/v2/common. |
Thank you! I'm on vacation for a week, pull requests welcome. I'll see what I can do while on the train. Already added a test image. |
Wow, looks like Adobe somehow managed to add XMP / Dublin Core data to the JPEG without using a sidecar file. That's why our Exif parser doesn't find it! <rdf:Description rdf:about=''
xmlns:dc='http://purl.org/dc/elements/1.1/'>
<dc:creator>
<rdf:Seq>
<rdf:li>Photographer: TMB</rdf:li>
</rdf:Seq>
</dc:creator>
<dc:format>image/jpeg</dc:format>
<dc:subject>
<rdf:Bag>
<rdf:li>Ladybug</rdf:li>
</rdf:Bag>
</dc:subject>
<dc:title>
<rdf:Alt>
<rdf:li xml:lang='x-default'>Ladybug</rdf:li>
</rdf:Alt>
</dc:title>
</rdf:Description> So what we need here is the XMP support we started working on plus a way to extract this data from a JPEG. In Exif, ImageDescription is the right field to store the title of an image. There is no Title field. |
For embedding XMP metadata in JPEG files, see https://wwwimages2.adobe.com/content/dam/acom/en/devnet/xmp/pdfs/XMP%20SDK%20Release%20cc-2016-08/XMPSpecificationPart3.pdf @dsoprea Any idea how we can implement this elegantly? |
@tmb80c Try using an XMP sidecar file instead for now. Is this possible? |
Apparently |
There seems to be a lot of JPEG talk for being an XMP document. The XMP data is just in another segment? What is it that you're concerned won't be done well/elegantly? Seems like it would just be a simple enumeration of the JPEG segments (which can be done via go-jpeg-image-structure) and to just scan/grab/test the one specified in the text above, no? |
I'm not using sidecar files in Lightroom. |
Possible, didn't try. I'm on vacation and on a train, that's as far as I got... With go-jpeg you mean the built-in JPEG lib that comes with Go? You're probably doing something similar to get the Exif data. |
go-jpeg-image-structure is my project, which I used from Photoprism to parse JPEGs and extract EXIF (which there are convenience functions for). I'll try to do it in the next couple of days. I'm fairly highly utilized at the moment. |
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
Hi,
came across of this exiting software. Not sure if the following is by design, a missing feature or a bug.
I uploaded some pictures (tried with and without sidecar file). The pictures were exports from Lightroom and included already a picture name/tile and some keywords. I could see in photoprism the EXIF data after the import but not the title / keywords from the picture file. I think title and keywords are not EXIF data but other Metadata which I can see under details in windows file explorer. Looks like photoprism does only import EXIF not title and keywords into its database. Although the imported picture file still includes the title and the keywords.
For example one picture was a macro of a ladybug. The picture name/title (not filename) was "ladybug" and the picture description included two keywords "ladybug" and "Insect". Indexing indentified it correctly as a beetle with 96% confidence - cool, great work! After indexing the title was set to "Beetle". And under labels I could only see "Beetle". I would have expected that the import would use the picture name as photoprism-title and lists under labels the imported keywords as "manual" or "imported" and the "beetle" as a result of indexing.
Another user expectation would be that photoprism uses the keywords from the imported picture to eliminate false positives. Meaning if the file already includes a keyword which matches labels or categories in photoprism then this information should help the indexing in particular if there is a low confidence.
If the above can not be implemented then reindexing should not override manual edited labels and titles after reindexing.
It is my first contribution to github.
The text was updated successfully, but these errors were encountered: