Patch #778
Add support for Windows Live Photo Gallery face tags
100%
Description
Hi.
I'm attempting to add support for WLPG face tags (Microsoft Photo 1.2 Schema).
http://msdn.microsoft.com/en-us/library/ee719905%28VS.85%29.aspx
I have a patch but I'm a little confused about what exactly the various values should be. exiv2 seems to allow me to write correct XMP regardless of some of the values I put into properties.cpp, so I don't know how to check if I'm doing this right. The tags are nested structures (see the bottom of the msdn link for an example).
My patch has these lines:
+ extern const XmpPropertyInfo xmpMPRegionInfo[] = {
+ // End of list marker
+ { "MPRI:Regions", N_("MPRI:Regions"), "Text", xmpBag, xmpExternal, N_("Bag of MPReg") },
+ { "DateRegionsValid", N_("DateRegionsValid"), "Text", xmpText, xmpExternal, N_("Date the last rectangle was created") },
+ { 0, 0, 0, invalidTypeId, xmpInternal, 0 }
+ };
Question 1: I think the MPRI:Regions line must be wrong, because no other line in that file has a ":" in that field. What should I be putting there instead?
Question 2: Should I be registering all three name spaces in xmp.cpp as I am now?
Question 3: Are there xmpText values in that file for documentation only? That is, would libexiv2 work without them? Because in my testing for MP it seemed like it worked without them.
For reference, here's how I'm using exiv2 after I apply the patch. The XMP looks right, but I think my patch probably has some problems.
src/exiv2 -M"set Xmp.MP.RegionInfo/MPRI:Regions XmpText type=Bag" example.xmp
src/exiv2 -M"set Xmp.MP.RegionInfo/MPRI:Regions1/MPReg:Rectangle 0.11 0.22 0.33 0.44" example.xmp
src/exiv2 -M"set Xmp.MP.RegionInfo/MPRI:Regions1/MPReg:PersonDisplayName Leif" example.xmp
Also, sorry, the patch is against 0.21.1. I am having difficulties getting the svn to compile.
Files
Related issues
Associated revisions
History
Updated by Gilles Caulier over 10 years ago
To compile Exiv2 from svn trunk, i recommend to use cmake script. Got to root folder and run "cmake .". Look the report. If there are some errors, please copy and paste the trace here...
Gilles Caulier
Updated by Leif Huhn over 10 years ago
[ 91%] Built target exiv2
Linking CXX executable exiv2
libexiv2.so.10.1.0: undefined reference to `Exiv2::newEpsInstance(std::auto_ptr<Exiv2::BasicIo>, bool)'
libexiv2.so.10.1.0: undefined reference to `Exiv2::isEpsType(Exiv2::BasicIo&, bool)'
collect2: ld returned 1 exit status
make2: * [src/exiv2] Error 1
make1: [src/CMakeFiles/exiv2bin.dir/all] Error 2
make: ** [all] Error 2
Updated by Andreas Huggel over 10 years ago
Looks like the new epsimage.[ch]pp files have not been added to the cmake build files. I'll fix that. In the meantime, compiling via the standard make config; ./configure; make; make install works.
Updated by Andreas Huggel almost 10 years ago
- Category set to xmp
- Target version set to 0.23
- % Done changed from 0 to 100
Fixed with #798.
Updated by Ananta Palani over 9 years ago
Andreas Huggel wrote:
Fixed with #798.
I'm not sure this is fixed. I think some of the questions need to be addressed still. As to Question 1, according to the spec all the fields need to be prefixed with their appropriate schema namespace, for instance MPRI:DateRegionsValid or MPReg:Rectangle. If this is done automatically by exiv2 based on the namespace then I think 'MPRI:Regions' should be changed to 'Regions'. If it is not done automatically, then the namespace prefix should be added to all properties.
Just from looking at the code, Question 2 looks like a 'yes', but I'm not sure. Question 3?
Also, is the <MP:RegionInfo> tag written by exiv2 automatically?
Updated by Andreas Huggel over 9 years ago
Ananta is right, I should have also answered the questions in the original report. "Fixed with #798" only says that the Microsoft Photo MP, MPRI and MPReg namespaces and tags have been added to the Exiv2 XMP property reference tables.
Question 1: Yes, the Exiv2 reference tables contain property names without any namespaces. The namespaces are registered separately. Look, e.g., for "xmpMicrosoftPhotoInfo" in properties.cpp to see how this was eventually implemented.
Question 2: Yes, that's right.
Question 3: The exiv2 utility uses a type explicitly given on the command line. The type in the reference tables is only used if none is provided on the command line and if an XMP property is not found in the reference tables, its default type is xmpText. In addition, the misbehavior noted in this context may have been due to bug #799.
Also, is the <MP:RegionInfo> tag written by exiv2 automatically?
In the commands used for the regression test case, it is set by the first line:
$ exiv2 -v -M'set Xmp.MP.RegionInfo/MPRI:Regions' exiv2-empty.jpg File 1/1: exiv2-empty.jpg Set Xmp.MP.RegionInfo/MPRI:Regions "" (XmpBag) $ exiv2 -pa exiv2-empty.jpg Xmp.MP.RegionInfo XmpText 0 type="Struct" Xmp.MP.RegionInfo/MPRI:Regions XmpBag 0 $ exiv2 -eX exiv2-empty.jpg $ cat exiv2-empty.xmp <?xml version="1.0" encoding="UTF-8"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 4.4.0-Exiv2"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:MP="http://ns.microsoft.com/photo/1.2/" xmlns:MPRI="http://ns.microsoft.com/photo/1.2/t/RegionInfo#"> <MP:RegionInfo rdf:parseType="Resource"> <MPRI:Regions> <rdf:Bag/> </MPRI:Regions> </MP:RegionInfo> </rdf:Description> </rdf:RDF> </x:xmpmeta>
Hope that answer the questions.
Andreas
Updated by Ananta Palani over 9 years ago
Andreas, thanks for the detailed answer, I should have checked svn before replying!
-Ananta
#778: Added epsimage.[ch]pp files to cmake scripts.