How to insert a color value into an image's xpacket?
my problem seemed simple: have computed property of image , want insert property image's metadata. in metadata see xpacket sorts of neatly recorded data. want add simple like:<br />] <br />i colorswatch: 0xff00bb<br /><br />] <br />b question 1: <br />will metadata harmed inserting <br />some text long delete equal number of <br />pre-existing blanks? there checksum? <br />do have use xmp sdk , program in c? <br /><br />so started reading. alphabet soup: xmp dc rdf rdfs . . . no 1 seems appreciate value of presenting little working example. pieced approach below.<br /><br />b question 2: <br />has approach prayer of doing useful? <br /><br />step 1 - define pixa:color tag. upload file to<br />i http://physpics.com/namespace/pixa.rdf:<br /><br /> <?xml version="1.0"?> <br /> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"<br /> xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"><br /> <rdfs:class rdf:id="color"><br /> <rdfs:subclassof <br /> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#resource"/><br /> </rdfs:class><br /> <rdfs:simpletype name='colordata'><br /> <rdfs:restriction base='hexbinary'><br /> <rdfs:length value='6' /><br /> </rdfs:restriction><br /> </rdfs:simpletype><br /> <rdf:property rdf:id="color"><br /> <rdfs:comment>color swatch value picture</rdfs:comment><br /> <rdfs:domain rdf:resource=""/> <rdfs:comment> ? </rdfs:comment><br /> <rdfs:range rdf:datatype="colordata" /> <br /> </rdf:property><br /><br />b question 3: <br />what domain? should somehow reference xpacket, guess.<br /><br />step 2 - add pixa namespace rdf:description. head of xpacket like.<br /><br /><?xpacket begin="" id="w5m0mpcehihzreszntczkc9d"?> <br /><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="3.1.2-114"><br /> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"<br /> xmlns:pa="http://physpics.com/namespace/pixa.rdf#"><br /> <rdf:description rdf:about=""<br /><br />note original about= value empty!<br /><br />step 3 - code insertion xpacket. believe (anyway, hope) looks this:<br /> <dc:description><br /> <rdf:alt><br /> <rdf:li><pixa:color>0xff00bb</pixa:color></rdf:li><br /> </rdf:alt><br /> </dc:description><br /><br />phew. that's it. work????<br /><br />thanks taking time work through this.<br />fred hansen
a more readable version of comment @ "how insert color property?"
and namespace/pixa.rdf exists.
More discussions in XMP SDK
adobe
Comments
Post a Comment