EXIF problem [Delphi]

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

Moderators: helmut, XnTriq, xnview

Post Reply
Philippe
Posts: 3
Joined: Wed Apr 28, 2004 11:27 am
Location: Ch'ti (France)
Contact:

EXIF problem [Delphi]

Post by Philippe »

Hello!

This is how I managed the EXIT in my file

Code: Select all

gflGetDefaultLoadParams(LoadParam);
LoadParam.Flags := GFL_LOAD_METADATA;
Erreur := gflLoadBitmap(NomFichier, GFLImage, LoadParam, InformationFichier);
if GFLBitmapHasEXIF(GFLImage) = GFL_True then
Exif := gflBitmapGetEXIF(GFLImage, EXIF_MAIN_IFD);

However I have the following error message "incorrect floating point operation" when I execute the function gflBitmapGetEXIF

the structure of EXIF is

Code: Select all

const
   EXIF_MAIN_IFD = $0001;
   EXIF_IFD_0 = $0002;
   EXIF_INTEROPERABILITY_IFD = $0004;
   EXIF_IFD_THUMBNAIL = $0008;
   EXIF_GPS_IFD = $0010;
   EXIF_MAKERNOTE_IFD  = $0020;

type
   TGFL_EXIF_ENTRY  = record
                       Flag  : GFL_UINT32; // EXIF_...IFD
                       Tag   : GFL_UINT32;
                       Name  : PCHAR;
                       Value : PCHAR;
                     end;
   PGFL_EXIF_ENTRY = ^TGFL_EXIF_ENTRY;

type
   TTabGFL_EXIF_ENTRY = array [0..0] of TGFL_EXIF_ENTRY;
   PTTabGFL_EXIF_ENTRY = ^TTabGFL_EXIF_ENTRY;
   TGFL_EXIF_DATA  = record
                      NumberOfItems : GFL_UINT32;
                      ItemsList     : PTTabGFL_EXIF_ENTRY; //PGFL_EXIF_ENTRY;
                    end;
   PGFL_EXIF_DATA = ^TGFL_EXIF_DATA;

The problem does not occur everytime I open a picture

Any ideas?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: EXIF problem [delphi]

Post by xnview »

Philippe wrote:This is how I managed the EXIT in my file
Seems to be correct!
However I have the following error message "incorrect floating point operation" when I execute the function gflBitmapGetEXIF
You have the problem on all picture with EXIF data?
Pierre.
Philippe
Posts: 3
Joined: Wed Apr 28, 2004 11:27 am
Location: Ch'ti (France)
Contact:

Post by Philippe »

not, much of photographs do not have the problem
Guest

Post by Guest »

Moreover, with these photographs, I cannot use the functions GFLResize or GFLRotate. I have an error "Error to create file" on the GFLSaveBitmap function.

Does somebody have an idea?
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Anonymous wrote:Moreover, with these photographs, I cannot use the functions GFLResize or GFLRotate. I have an error "Error to create file" on the GFLSaveBitmap function.
Does somebody have an idea?
Could you tell me more about these photos? Or send me example?
Pierre.
Kobby
Posts: 2
Joined: Fri Nov 10, 2006 2:26 pm

Post by Kobby »

Same problem. I use VC.Net with a similar code:

Code: Select all

	GFL_LOAD_PARAMS params; 
	GFL_BITMAP gflBitmap; 
	GFL_BITMAP *pgflBitmap = &gflBitmap; 
	GFL_ERROR error; 
	gflGetDefaultLoadParams(&params);

	error = gflLoadBitmap(strFileName, &pgflBitmap, &params, NULL);
	if (error == GFL_NO_ERROR)
	{

		if(	gflBitmapHasEXIF(pgflBitmap))
		{
			GFL_EXIF_DATA *pEXIF = 	gflBitmapGetEXIF(pgflBitmap, 0);
			for (int i = 0; i<pEXIF>NumberOfItems; i++)
			{
				ATLTRACE2( atlTraceGeneral, 4,"%s\t%s\r\n",pEXIF->ItemsList[i].Name,pEXIF->ItemsList[i].Value);

				
			}
		}
I always get an access violation error on the gflBitmapHasEXIF.
Any thoughts?
Kobby
Posts: 2
Joined: Fri Nov 10, 2006 2:26 pm

Post by Kobby »

Ops,
I just did not swich on flage GFL_LOAD_METADATA.
It works fine now.
Post Reply