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
 [IEvolution] Exif_UserComment does not save
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

MattOV

Australia
17 Posts

Posted - Jun 13 2012 :  07:30:45  Show Profile  Reply
I Have been using Ievolution to edit Exif data and have no problems with any of the tags except the UserComemnt tag which never saves after I add string data to it. IS there any limitations to what how data can be entered?

thanks
matt

w2m

USA
1990 Posts

Posted - Jun 13 2012 :  11:22:16  Show Profile  Reply
I tried the EXIF demo and found the EXIF_UserComment was not saved as well... The XPComment was saved however.

William Miller
Go to Top of Page

fab

1310 Posts

Posted - Jun 18 2012 :  01:30:22  Show Profile  Reply
It is necessary to specify how the string will be coded (ASCII or Unicode) using EXIF_UserCommentCode. Example:
ImageEnView1.IO.LoadFromFile('input.jpg');
ImageEnView1.IO.Params.EXIF_UserComment := 'Hello World!';
ImageEnView1.IO.Params.EXIF_UserCommentCode := IEEXIFUSERCOMMENTCODE_UNICODE;
ImageEnView1.IO.Params.EXIF_HasEXIFData := true;
ImageEnView1.IO.SaveToFileTIFF('test.tiff');

...and read back....
ImageEnView1.IO.LoadFromFileTIFF('test.tiff');
ShowMessage( ImageEnView1.IO.Params.EXIF_UserComment );


IEEXIFUSERCOMMENTCODE_UNICODE is defined in imageenio unit.
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jun 18 2012 :  07:56:31  Show Profile  Reply
Fabrizio, Although you "hinted" about this in the help file, the help file was not clear about this. I'd add your example to your help file.

TIOParams.EXIF_UserComment


Declaration

property EXIF_UserComment:WideString


Description

EXIF_UserComment is a tag to write keywords or comments on the image besides those in EXIF_ImageDescription, and without the character code limitations of the EXIF_ImageDescription tag.
The character code is specified by the EXIF_UserCommentCode property.

It is necessary to specify how the string will be coded (ASCII or Unicode) when using the EXIF_UserCommentCode. For Delphi 2010 or higher you should use ImageEnView1.IO.Params.EXIF_UserCommentCode := IEEXIFUSERCOMMENTCODE_UNICODE as shown in the example below:

Example:
ImageEnView1.IO.LoadFromFile('input.jpg');
ImageEnView1.IO.Params.EXIF_UserComment := 'Hello World!';
ImageEnView1.IO.Params.EXIF_UserCommentCode := IEEXIFUSERCOMMENTCODE_UNICODE;
ImageEnView1.IO.Params.EXIF_HasEXIFData := true;
ImageEnView1.IO.SaveToFileTIFF('test.tiff');
 ...and read back....
ImageEnView1.IO.LoadFromFileTIFF('test.tiff');
ShowMessage( ImageEnView1.IO.Params.EXIF_UserComment );

The IEEXIFUSERCOMMENTCODE_UNICODE is defined in the imageenio unit.

William Miller
Go to Top of Page

MattOV

Australia
17 Posts

Posted - Jun 18 2012 :  17:19:58  Show Profile  Reply
Thanks for the clarification Fabrizio.

And thanks William for the follow up too :)
Go to Top of Page

fab

1310 Posts

Posted - Jun 18 2012 :  22:28:14  Show Profile  Reply
Thank you Bill, documentation updated!
Actually it is possible to use UNICODE also in previous Delphi versions, because EXIF_UserCommentCode is WideString.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: