ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Trying to read xmp tags
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

nwscomps

185 Posts

Posted - May 16 2016 :  12:40:57  Show Profile  Reply
Hello, I am trying without success to read the xmp tags from file.
Although the XMP_Info is filled correctly, it seems the parsing is missing the fields I want to read. Actually no field is read.

I tried using both:

for I := 0 to XmpTags.Count-1 do
begin
aGrid.cells[0,i] := XmpTags[i].Name;
aGrid.cells[1,i] := ftmpparams.XMP_AsStr[XmpTags[i].Name];
end;

and the other method

dict := ftmpParams.Dict.GetDictionary('XMP');
for I := 0 to XmpTags.Count-1 do
begin
aGrid.cells[0,i] := XmpTags[i].Name;
try
aGrid.cells[1,i] := dict.GetString(XmpTags[i].Name);
except
end;
end;

I have created a stringlist with the names of the tags I want to read.
For example I added the following tags:
Iptc4xmpCore:CreatorContactInfo
Iptc4xmpCore:CiAdrCity
Iptc4xmpCore:CiAdrCtry
Iptc4xmpCore:CiAdrExtadr
Iptc4xmpCore:CiAdrPcode
Iptc4xmpCore:CiAdrRegion

The test image: http://metadatadeluxe.pbworks.com/f/1242756531/IPTCpanel.jpg

Thank you for any answer,
Francesco


Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library

nwscomps

185 Posts

Posted - May 16 2016 :  12:59:24  Show Profile  Reply
Here is a complete example code:

procedure TForm1.Button1Click(Sender: TObject);
var
tags:tstringlist;
  I: Integer;
begin

  imageenview1.IO.LoadFromFile('D:\test\IPTCpanel.jpg');
  tags := tstringlist.create;
  try
    tags.add('Iptc4xmpCore:CreatorContactInfo');
    tags.add('Iptc4xmpCore:CiAdrCity');
    tags.add('Iptc4xmpCore:CiAdrCtry');
    tags.add('Iptc4xmpCore:CiAdrExtadr');
    tags.add('Iptc4xmpCore:CiAdrPcode');
    tags.add('Iptc4xmpCore:CiAdrRegion');


     for I := 0 to tags.count-1 do
       showmessage(imageenview1.IO.Params.XMP_AsStr[tags[i]]);
  finally
    tags.free;
  end;
end;

All the tag values read are empty.

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

xequte

39053 Posts

Posted - May 17 2016 :  18:36:17  Show Profile  Reply
Hi Francesco

This code works fine for me. What version of ImageEn are you using?

procedure TMainForm.Button1Click(Sender: TObject);
var
  tags:tstringlist;
  I: Integer;
begin
  imageenview1.IO.LoadFromFile('D:\test\IPTCpanel.jpg');
  tags := tstringlist.create;
  try
  tags.add('Iptc4xmpCore:CreatorContactInfo');
  tags.add('Iptc4xmpCore:CiAdrCity');
  tags.add('Iptc4xmpCore:CiAdrCtry');
  tags.add('Iptc4xmpCore:CiAdrExtadr');
  tags.add('Iptc4xmpCore:CiAdrPcode');
  tags.add('Iptc4xmpCore:CiAdrRegion');


  Memo1.Text := '';
  for I := 0 to tags.count-1 do
    Memo1.Lines.Add( tags[i] + ': ' + ImageEnView1.IO.Params.XMP_AsStr[ tags[ i ]]);
  finally
    tags.free;
  end;
end;



Iptc4xmpCore:CreatorContactInfo: IPTC COPANEL: POSTAL
Iptc4xmpCore:CiAdrCity: IPTC CONTACT PANEL: CITY
Iptc4xmpCore:CiAdrCtry: IPTC CONTACT PANEL: COUNTRY
Iptc4xmpCore:CiAdrExtadr: IPTC CONTACT PANEL: ADDRESS
Iptc4xmpCore:CiAdrPcode: IPTC COPANEL: POSTAL
Iptc4xmpCore:CiAdrRegion: IPTC CONTACT PANEL: STATE/PROVINCE


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

nwscomps

185 Posts

Posted - May 18 2016 :  09:28:22  Show Profile  Reply
Hello Nigel,
I am using v. 6.2.2 on DXE2

Your XMPDemo also found here:
http://imageen.com/ieforum/topic.asp?TOPIC_ID=1446&whichpage=3&SearchTerms=xmp
cannot read the metadata in this picture (Date of the exe is 13/05/2015)

I have uploaded my demo project with the image file included, at my website:
http://www.nwscomps.com/downloads/test_metadata.zip
In my case all the values read are empty.

Thank you,
Francesco



Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

xequte

39053 Posts

Posted - May 18 2016 :  18:43:35  Show Profile  Reply
Hi Francesco

I'm using the XMP demo, but compiling in v6.3.0. Please email me and I'll give you an update.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

HeCaRe

Germany
1 Posts

Posted - Oct 30 2018 :  10:16:02  Show Profile  Reply
I have a problem:

I have tried to compile the XMP-example and get the error message undeclated identifier XMP_AsStr.
What am I doing?
Go to Top of Page

xequte

39053 Posts

Posted - Oct 30 2018 :  15:21:22  Show Profile  Reply
XMP_AsStr uses a class helper in the unit iexMetaHelpers.pas. So ensure iexMetaHelpers is in your uses clause.

Also, what version of Delphi are you using?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: