Error EXIF Data in Nikon

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

Error EXIF Data in Nikon

Post by madiazg »

Hi,
I am using version 3.15 of GFL SDK. If I Load an image and saving it, EXIF data are saved correctly:

Code: Select all

    gflLibraryInit();
    gflGetDefaultLoadParams(mLoadOption);
    mLoadOption.Flags := GFL_LOAD_READ_ALL_COMMENT;
    mLoadOption.Flags := GFL_LOAD_METADATA;
    mError := gflLoadBitmap(Pchar(FileName1),mOriBitmap, mLoadOption, lInformation); // Carga una imagen en Memoria

    gflGetDefaultSaveParams(mSaveOption);
    mSaveOption.Flags := GFL_SAVE_REPLACE_EXTENSION;
    mSaveOption.Flags := GFL_SAVE_ICC_PROFILE;
    mSaveOption.FormatIndex := 0;
    mSaveOption.Quality := 50;
    gflSaveBitmap(PChar('prueba.jpg'),mOriBitmap,mSaveOption);
If I load the EXIF data and then I save them

Code: Select all

    gflLibraryInit();
    gflGetDefaultLoadParams(mLoadOption);
    mLoadOption.Flags := GFL_LOAD_READ_ALL_COMMENT;
    mLoadOption.Flags := GFL_LOAD_METADATA;
    mError := gflLoadBitmap(Pchar(FileName1),mOriBitmap, mLoadOption, lInformation); // Carga una imagen en Memoria

//EXIF 2
    mEXIFData2 := gflBitmapGetEXIF2(mOriBitmap);

    gflBitmapRemoveMetaData(mOriBitmap);
    gflBitmapSetEXIF2(mOriBitmap,mEXIFData2);

    gflGetDefaultSaveParams(mSaveOption);
    mSaveOption.Flags := GFL_SAVE_REPLACE_EXTENSION;
    mSaveOption.Flags := GFL_SAVE_ICC_PROFILE;
    mSaveOption.FormatIndex := 0;
    mSaveOption.Quality := 50;
    gflSaveBitmap(PChar('prueba.jpg'),mOriBitmap,mSaveOption);
    gflFreeEXIF2(mEXIFData2);
there are errors in the following fields:
  • x Resolution
    y Resolution
    Exposure Time
    Focal Length
Curiously, if I load the previously saved image and I save it, EXIF data is stored correctly as in the original image. That is, the second copy retains the EXIF data correctly.

This error does not occur with other camera models

You can download an image here:
http://personal.telefonica.terra.es/web ... mg0022.jpg

Miguel Angel
http://imagen3d.site88.net
User avatar
madiazg
Posts: 82
Joined: Wed Jul 18, 2007 8:00 pm
Location: Tenerife - Islas Canarias

Re: Error EXIF Data in Nikon

Post by madiazg »

Hi,
have you been able to find out what the problem?

Miguel Angel
http://imagen3d.site88.net