Hi,
I can show xmp data in xnview but I can't read this data with gflsdk...
where can I find some help to read xmp data in jpeg file ?
Help me !
--
Regards,
Stéphane.
[GFL SDK v2.82][XMP] - How to read xmp data ?
Moderators: XnTriq, helmut, xnview
-
- Posts: 2
- Joined: Sat Jun 28, 2008 9:23 pm
-
- Posts: 2
- Joined: Sat Jun 28, 2008 9:23 pm
[SOLVED][GFL SDK v2.82][XMP] - How to read xmp data ?
I found the solution...
Example in C++:
thanks to Omar Shahine.
--
Stéphane.
Example in C++:
Code: Select all
AnsiString TfExif::GetXmpFromStream (TMemoryStream *stream)
{
AnsiString xmlPart;
char *beginCapture = "<rdf:RDF";
char *endCapture = "</rdf>";
int beginPos;
int endPos;
char *ptr, *maxPtr;
for (
ptr = (char*)stream->Memory, maxPtr = ptr + stream->Size;
memcmp (ptr, beginCapture, 8) && ptr < maxPtr;
++ptr
);
if (ptr != maxPtr) {
beginPos = ptr - (char*)stream->Memory;
//Memo->Lines->Append ("beginPos= " + IntToStr (beginPos));
for (; memcmp (ptr, endCapture, 10) && ptr < maxPtr; ++ptr);
if (ptr != maxPtr) {
endPos = ptr - (char*)stream->Memory;
//Memo->Lines->Append ("endPos= " + IntToStr (endPos));
int xmlLength = endPos - beginPos + 10;
xmlPart.SetLength (xmlLength);
stream->Seek (beginPos, soFromBeginning);
stream->Read (xmlPart.c_str (), xmlLength);
}
}
return xmlPart;
}
--
Stéphane.