Archived Forum Post

Index of archived forum posts

Question:

XMP packets not recognized

Mar 21 '14 at 00:14

Hi Matt, I'm using the latest version ChilkatXMP ActiveX component (9.5.0.0) with Delphi 5. When I try to read the XMP packet from a JPG that opens up fine in Photoshop, it doesn't work. The fileinfo also shows correctly in Photoshop. The XML document returns a value of 1 for NumEmbedded, but getting the first XML doc returns nil.

I've set debug logging on and it says:

LoadJpg:
    segType: 0xd8
    M_SOI.
    segType: 0xe1
    segmentSize: 7391
    Parsing XMP data...
    parseXmpData1:
        (leaveContext)
    XMP does not begin with xpacket.

This is the code used to read the XMP:

function ReadXMPinfo( InputFile: string ): string;
var
  i: integer;
  xml: IChilkatXml;
  ChilXMP: TChilkatXmp;

begin
  ChilXMP := TChilkatXMP.Create(nil);
  try
    // ---- DEBUGGING -----
    ChilXMP.VerboseLogging := 1;
    ChilXMP.DebugLogFilePath := 'C:\ChilLog.txt';
    // ---- DEBUGGING -----

    if ChilXMP.UnlockComponent('our unlock code') = 1 then
    begin
      if ChilXMP.LoadAppFile( InputFile ) > 0 then
      begin
        for i:= 0 to ChilXMP.NumEmbedded-1 do
        begin
          xml := ChilXMP.GetEmbedded(i);  // <-- returns nil
          if xml <> nil then
            LoadXMLtags( xml.GetRoot, List ); // function loads XML nodes into stringlist
          Result := List.CommaText;
        end;    
      end;
    end; 
  except
    on E: Exception do
      Result := 'ERROR='+E.Message;
  end;
end;

It happens with multiple images, but I've emailed one of them (00185383.jpg) to your support address.


Answer

These new builds should fix it:

32-bit: http://www.chilkatsoft.com/preRelease/ChilkatXmp-9.5.0-win32.zip

64-bit: http://www.chilkatsoft.com/preRelease/ChilkatXmp_x64-9.5.0-x64.zip