Patch #778

Add support for Windows Live Photo Gallery face tags

Added by Leif Huhn almost 6 years ago. Updated about 5 years ago.

Status:ClosedStart date:13 Jul 2011
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:xmp
Target version:0.23

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.

exiv2.diff Magnifier - Proposed patch to add Microsoft Photo 1.2 Schema (3.7 KB) Leif Huhn, 13 Jul 2011 15:09


Related issues

Related to Exiv2 - Patch #798: Add MS Photo RegionInfo and MetaWorkingGroup Regions schemas Closed 11 Jan 2012

Associated revisions

Revision 2568
Added by Andreas Huggel almost 6 years ago

#778: Added epsimage.[ch]pp files to cmake scripts.

History

#1 Updated by Gilles Caulier almost 6 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

#2 Updated by Leif Huhn almost 6 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

#3 Updated by Andreas Huggel almost 6 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.

#4 Updated by Andreas Huggel almost 6 years ago

r2568 should fix the cmake compilation issue.

#5 Updated by Andreas Huggel over 5 years ago

  • Category set to xmp
  • Target version set to 0.23
  • % Done changed from 0 to 100

Fixed with #798.

#6 Updated by Ananta Palani about 5 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?

#7 Updated by Andreas Huggel about 5 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

#8 Updated by Ananta Palani about 5 years ago

Andreas, thanks for the detailed answer, I should have checked svn before replying!
-Ananta

#9 Updated by Andreas Huggel about 5 years ago

  • Status changed from New to Resolved

#10 Updated by Andreas Huggel about 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF

Redmine Appliance - Powered by TurnKey Linux