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
 IPTC with JP2?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Apr 07 2015 :  11:13:58  Show Profile  Reply
Hi! I am trying to write/read IPTC Caption to a JP2 File:

ImageEn1.IO.Params.WriteIPTCField(PhotoShop_IPTC_Records, IPTC_PS_Caption, Memo1.Lines.Text);
ImageEn1.IO.SaveToFileJP2('D:\MyImage.jp2');

Memo1.Lines.Text := ImageEn1.IO.Params.ReadIPTCField(PhotoShop_IPTC_Records, IPTC_PS_Caption);


But it does not work. Is IPTC not possible with JP2? Which other method is recommended for JP2?

xequte

38616 Posts

Posted - Apr 07 2015 :  11:23:11  Show Profile  Reply
Hi

IPTC and EXIF metadata are not supported with JPEG2000.

You should be able to use XMP data (off the top of my head):

http://www.imageen.com/help/TIOParamsVals.Dict.html


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

PeterPanino

933 Posts

Posted - Apr 07 2015 :  11:59:03  Show Profile  Reply
With this code:

ImageEn1.IO.Params.Dict.GetDictionary('XMP')


I get this error:

quote:
Key "XMP" not found.


Could you please show an example how to write and read a text comment to/from a JP2 file? Thank you in advance!

Go to Top of Page

PeterPanino

933 Posts

Posted - Apr 09 2015 :  05:23:00  Show Profile  Reply
I have tried this code with a JP2 image file which has no XMP metadata yet:

ImageEn1.IO.LoadFromFileAuto('D:\MyImage.JP2');
ImageEn1.IO.Params.dict.Assign(TIEDictionary.Create());
ImageEn1.IO.Params.dict.Insert('MyKey', 'Some Text');
ImageEn1.IO.SaveToFileJP2('D:\MyImage.JP2');


However, it does not seem to work. I opened the saved file with ExifToolGUI to see whether there are any XMP metadata in it: None.
Go to Top of Page

PeterPanino

933 Posts

Posted - Apr 09 2015 :  10:48:10  Show Profile  Reply
When I insert a key into the dictionary with:

ImageEn1.IO.Params.dict.Insert('MyKey', 'Some text');
ImageEn1.IO.SaveToFileJP2('D:\MyImage.jp2');


then I can retrieve it with:

if ImageEn1.IO.Params.dict.HasKey('MyKey', True) then
  CodeSite.Send('JP2 XMP Key', ImageEn1.IO.Params.dict.GetString('MyKey', True));


But it seems the dictionary is not saved into the file with SaveToFileJP2. Because when I restart the program and reload the JP2 file, the XMP key cannot be retrieved anymore as above.

So how can the XMP key be saved in the file?
Go to Top of Page

xequte

38616 Posts

Posted - Apr 11 2015 :  02:55:04  Show Profile  Reply
Hi

Sorry, I may have steered you wrong (I am out of the office at the moment so could not investigate). I'm not sure that ImageEn actually save the XMP data. I'll confirm this when I am back in the office (after next Friday).

You should consider using one of the image formats with native meta data support.


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

PeterPanino

933 Posts

Posted - Apr 11 2015 :  03:15:29  Show Profile  Reply
Hi Nigel, thanks for your help. I have to add textual metadata support (write and read) to as many as possible image formats.

Currently I can do this successfully for: GIF, TIFF, TIF, PNG, JPEG (JPG, JPEG, JPE, JIF, JFIF).

But still investigating for PSD and JP2.

With PSD and IO.Params.XMP_Info I get a more or less large XML string, but don't know how to add my own custom field to this XML structure in a conform way, so the XMP XML would still work in PS.
Go to Top of Page

xequte

38616 Posts

Posted - Apr 20 2015 :  23:54:48  Show Profile  Reply
Hi

To clarify, ImageEn saves the XMP_Info tag for Jpeg, TIFF and PSD formats. The XMP data in Params.Dict is not saved, so you would need to modify XMP_Info directly.


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