I need help to save EXIF data in DELPHI

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, xnview

User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

I need help to save EXIF data in DELPHI

Post by madiazg »

Hello,
I have problems to save EXIF data in DELPHI.

Code: Select all

var
  EXIF2 : PGFL_EXIF_DATAEX;
....
begin
    gflEnableLZW(GFL_TRUE);
    gflGetDefaultLoadParams(lp);
    lp.ColorModel := GFL_BGR;
    lp.LinePadding := 4;
    gflLoadBitmap(Pchar(FileName1),gfl_bmp, lp, finfo);
//EXIF 2
    if gflBitMapHasEXIF(gfl_bmp1b) = gfl_no_error then
    begin
      EXIF2 := gflBitmapGetEXIF2(gfl_bmp);
........
      gflBitmapSetEXIF2(gfl_bmp,EXIF2);
      gflFreeEXIF2(EXIF2);
      gflGetDefaultSaveParams(sp);
      sp.FormatIndex := gflGetFormatIndexByName('jpeg');
      gflSaveBitmap(PChar('prueba.jpg'),gfl_bmp,sp);
    end;
...
end;
EXIF2 not load any data. After saving the EXIF data and save the file, the EXIF data in the PRUEBA.JPG file appear in white.
What's happening?
Rgds,
Miguel Angel
User avatar
xnview
Author of XnView
Posts: 36291
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: I need help to save EXIF data in DELPHI

Post by xnview »

Please use GFL_LOAD_METADATA
Pierre.
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

Post by madiazg »

Thank you very much,
It works perfectly.