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
 Why is there a unicode string problem DXE4
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Jun 18 2014 :  11:58:17  Show Profile  Reply
It appears there is a problem with JPEG_MarkerList and Unicode... sometimes...
var
  iImage: PAnsiChar;
  iCreator: PAnsiChar;
  iWebsite: PAnsiChar;
  iMisc: PAnsiChar;
  iNote: PAnsiChar;
begin
  iImage := PAnsiChar('Image: Shuttle324');
  iCreator := PAnsiChar('Creator: NASA');
  iWebsite := PAnsiChar('Website: www.NASA.com');
  iMisc :=  PAnsiChar('October, 1997.  All rights reserved.');
  iNote := PAnsiChar('This is a demo image.');
  { Add the JPEG Markers }
  ImageEnView1.IO.Params.JPEG_MarkerList.AddMarker(JPEG_COM,
      iImage, length(iImage));
    ImageEnView1.IO.Params.JPEG_MarkerList.AddMarker(JPEG_COM,
      iCreator, length(iCreator));
    ImageEnView1.IO.Params.JPEG_MarkerList.AddMarker(JPEG_COM,
      iWebsite, length(iWebsite));
    ImageEnView1.IO.Params.JPEG_MarkerList.AddMarker(JPEG_COM,
      iMisc, length(iMisc));
    ImageEnView1.IO.Params.JPEG_MarkerList.AddMarker(JPEG_COM,
      iNote, length(iNote));
{ Set the info label captions}
  InfoImage1.Caption := string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[0]);
  InfoCreator1.Caption := string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[1]);
  InfoWebsite1.Caption := string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[2]);
  InfoMisc1.Caption := string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[3]);
  InfoNotes1.Caption := string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[4]);

Why is there a problem with the first and last captions with Delphi XE4 but not the 2nd and 3rd and 4th captions?



If the captions are filled without JPEG_MarkerList the captions are correct?
{ Set the info }
InfoImage1.Caption := string(iImage); //string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[0]);
InfoCreator1.Caption := string(iCreator);//string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[1]);
InfoWebsite1.Caption := string(iWebsite);//string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[2]);
InfoMisc1.Caption := string(iMisc); //string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[3]);
InfoNotes1.Caption := string(iNote); //string(ImageEnView1.IO.Params.JPEG_MarkerList.MarkerData[4]);



Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

xequte

39053 Posts

Posted - Jun 18 2014 :  19:03:29  Show Profile  Reply
Hi Bill

I don't have the code right in front of me, but do you need to null terminate the values?

Also, why not use the standard EXIF fields for this data?



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

w2m

USA
1990 Posts

Posted - Jun 19 2014 :  05:08:57  Show Profile  Reply
Thanks Nigel.

I fixed the problem by changing length(iImage) to LStrLenA(iImage).
EXIF may not work because it would overwrite existing EXIF values and some fields do not have a corresponding EXIF field like Website.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: