A patch so that digikam can read face tags made by Picasa. Reproducible: Always
Created attachment 76942 [details] Read face tags made by Picasa
Hello, I'm trying to test your patch, but it seem that my build doesn't recognize any faces from Picassa tagged images. Maybe Picassa doesn't save tags, can you give me some samples that you used for testing? Thanks, Veaceslav
Hi! Are you sure that the image file has the tags? To make Picasa store face tags in image file, you have to enable that in Options. Please check the image with: exiv2 -pa image.jpg See also article: http://gcoupe.wordpress.com/2011/12/10/picasa-versus-windows-live-photo-gallery/ section "People Tags" (In reply to comment #2) > Hello, I'm trying to test your patch, but it seem that my build doesn't > recognize any faces from Picassa tagged images. > > Maybe Picassa doesn't save tags, can you give me some samples that you used > for testing? > > Thanks, > > Veaceslav
Yes, I enabled that option and exiv2 show me: Xmp.mwg-rs.Regions/mwg-rs:RegionList[1] XmpText 0 type="Struct" Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Name XmpText 3 Dan Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Type XmpText 4 Face Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area XmpText 0 type="Struct" Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:x XmpText 8 0.515046 Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:y XmpText 8 0.276427 Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:w XmpText 8 0.196245 Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:h XmpText 8 0.354552 Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:unit XmpText 10 normalized Xmp.mwg-rs.Regions/mwg-rs:RegionList[2] XmpText 0 type="Struct" Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Name XmpText 7 Claudia Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Type XmpText 4 Face Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area XmpText 0 type="Struct" Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:x XmpText 8 0.691358 Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:y XmpText 8 0.260417 Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:w XmpText 8 0.116255 Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:h XmpText 8 0.209877 Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:unit XmpText 10 normalized Where Dan and Claudia are tags name... So far I forced digikam to scan for faces, read metadata from images, update database, but still no tags from pacassa images. Also I surrounded you patch with debug statements and I saw that DMetadata::getImageFacesMap() is not called at all.
Try to force Digikam to re-read metadata from image: From main menu: Album -> Reread Metadata From Images or, select the image, and from main menu: Image -> Reread Metadata From Image That should do the trick! (In reply to comment #4) > Yes, I enabled that option and exiv2 show me: > > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1] XmpText 0 type="Struct" > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Name XmpText 3 Dan > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Type XmpText 4 Face > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area XmpText 0 > type="Struct" > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:x XmpText 8 > 0.515046 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:y XmpText 8 > 0.276427 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:w XmpText 8 > 0.196245 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:h XmpText 8 > 0.354552 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[1]/mwg-rs:Area/stArea:unit XmpText > 10 normalized > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2] XmpText 0 type="Struct" > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Name XmpText 7 Claudia > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Type XmpText 4 Face > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area XmpText 0 > type="Struct" > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:x XmpText 8 > 0.691358 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:y XmpText 8 > 0.260417 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:w XmpText 8 > 0.116255 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:h XmpText 8 > 0.209877 > Xmp.mwg-rs.Regions/mwg-rs:RegionList[2]/mwg-rs:Area/stArea:unit XmpText > 10 normalized > > Where Dan and Claudia are tags name... > > So far I forced digikam to scan for faces, read metadata from images, update > database, but still no tags from pacassa images. > > Also I surrounded you patch with debug statements and I saw that > DMetadata::getImageFacesMap() is not called at all.
Yes I did it multiple times, no tags so far. Now I'm trying to follow traces to see why getImageFacesMap() is not called.
Ok.. Sorry it was my problem :D Messed up cmake install prefix and also had digikam installed into multiple places... Now everything works fine :) I will notify Gilles.
Are you sure? The metadata standard proposed by the Metadata Working Group is currently not implemented. (we should, and replace our non-standard solution)
Marcel, I've tested this patch with some photos tagged by Picassa and it works ok. Digikam is able to read them/store and display. Should I commit this patch?
Well, it seem that I let a bug to slip in.... :) When I saw this bug: https://bugs.kde.org/show_bug.cgi?id=277429 and read Marcel's comment about image rotation and it's dependency upon the face tag rectangle, I decided to test face tagged by Picassa images. After rotation, all tags are out of position, even Digikam native tags, but when you rotate back, tags are in position, except Picassa's tags. After rotation clockwise and back, you get extra tags. I had 2 tag in an image, know I have 4 tags, 2 of them are garbage. Kristian, please take a look: Steps to reporduce: 1. Rotate clockwise a Picassa tagged image 2. Rotate anticlockwise 3. Go to next image 4. Turn back to rotated image. 5. You should see more tags than usual.
Veaceslav, I can confirm the bug. Following your instructions, at step 5, I did indeed get more tags than [expected ]usual.
Kristian, can you fix this? I already committed your patch, but with this bug it's not ok to leave it...
Sure! Will do. (In reply to comment #12) > Kristian, can you fix this? I already committed your patch, but with this > bug it's not ok to leave it...
Hi Veaceslav, After doing some investigation it looks like this is not a new bug. You'll get the same behavior if you use the attached example.jpg (https://bugs.kde.org/attachment.cgi?id=59036) from bug 271030. Also bug 277429 conatins interesing info, especially comment 16, with a link to https://git.reviewboard.kde.org/r/109087/ (I think it your stuff, right?) Anyways, the problem with duplicated, or additional face tags being added is that when the image is rotated, i re-reads the image and its metadata. So, we need to write metadata as you suggested in you last comment (in https://git.reviewboard.kde.org/r/109087/)
Garbage tags fixed in picassafacetag that was merged into master: http://quickgit.kde.org/?p=digikam.git&a=commit&h=0e69485123b1a4938e2c338a9c5142972b89bf82 Thank you, Kristian !