Page 1 of 1

X,Y Resolution

Posted: Wed Feb 18, 2009 8:50 pm
by madiazg
I have problems to store the X and Y Resolution of a photo
This datas are Rational's type.
Can you tell me how to be added X and Y Resolution to the EXIF information of the picture?
Miguel Angel

Posted: Wed Feb 18, 2009 10:36 pm
by dominique
For X, Y resolution, I'm not shure is what you need but try to modifiy Xdpi and Ydpi in the GFL_BITMAP structure.

For other EXIF field : ... light=exif

Posted: Fri Feb 20, 2009 5:46 pm
by madiazg
Hello Dom
In the EXIF data, Xdpi and Ydpi are datas type Rational.
I tried to save these data as follows:

Code: Select all

gflBitmapSetEXIFValueRational2(EXIF2, 1, 283, P, Q); //yDpi
but I can not find appropriate values of P and Q so that the resolution was well saved.

To DPI = 200, what values of P and Q should I indicate in gflBitmapSetEXIFValueRational2?

Miguel Angel

Posted: Fri Feb 20, 2009 5:52 pm
by dominique
I dont know ! I never try this.
As a rationnal is determine by the ratio P/Q, you should try P = 200 and Q = 1

Posted: Sat Feb 21, 2009 12:45 pm
by madiazg
Hello DOM
according to the information I have obtained:

The number of pixels per ResolutionUnit in the ImageWidth direction. When the image resolution is unknown, 72
[dpi] is designated.
Tag = 282 (11A.H)
Count = 1
Default = 72

If I use the values P = 200 and Q = 1, the result is:

X Resolution: 134228553/67108864

For me, this is a mystery!

Miguel Angel

Posted: Sat Feb 21, 2009 2:42 pm
by madiazg
I have found this information:

IFD data structure
At Exif format, the first IFD is IFD0(IFD of main image), then it links to IFD1(IFD of thumbnail image) and IFD link is terminated. But IFD0/IFD1 doesn't contain any digicam's information such as shutter speed, focal length etc. IFD0 always contains special Tag Exif Offset(0x8769), it shows an offset to Exif SubIFD. Exif SubIFD is IFD formatted data also, it contains digicam's information.

0000: 49 49 2A 00 08 00 00 00-02 00 1A 01 05 00 01 00
0010: 00 00 26 00 00 00 69 87-04 00 01 00 00 00 11 02
0020: 00 00 40 00 00 00 48 00-00 00 01 00 00 00

If the first part of TIFF data is above, it can read as;

* The first 2bytes are "I I", byte align is 'Intel'.
* Address 0x0004~0x0007 is 0x08000000, IFD0 starts from address '0x0008'
* Address 0x0008~0x0009 is 0x0200, number of directory entry of IFD0 is '2'.
* Address 0x000a~0x000b is 0x1A01, it means this is a XResolution(0x011A) Tag, it contains a horizontal resolution of image.
* Address 0x000c~0x000d is 0x0500, format of this value is unsigned rational(0x0005).
* Address 0x000e~0x0011 is 0x01000000, number of components is '1'. Unsigned rational's data size is 8bytes/components, so total data length is 1x8=8bytes.
* Total data length is larger than 4bytes, so next 4bytes contains an offset to data.
* Address 0x0012~0x0015 is 0x26000000, XResolution data is stored to address 0x0026
* Address 0x0026~0x0029 is 0x48000000, numerator is 72, address 0x002a~0x002d is 0x0100000000, denominator is '1'. So the value of XResoultion is 72/1.

In an original image, the EXIF data for the resolution are:


If I save the EXIF information:

Code: Select all

gflBitmapSetEXIFValueRational2(EXIF2, 1, 282, 72, 1);
I get the followings datas:

Data: .....

procedure gflBitmapSetEXIFValueRational2(exif: PGFL_EXIF_DATAEX; ifd, tag: GFL_UINT16; p,q: GFL_UINT32); stdcall;

do you find some explanation?

Miguel Angel

Re: X,Y Resolution

Posted: Tue May 19, 2009 7:26 pm
by dominique
Do you have some news about EXIF X/Y resolution ?

Re: X,Y Resolution

Posted: Sat May 23, 2009 5:27 pm
by madiazg
I have no new information about this topic. I hoped that you would find the solution to record the resolution. I am also very keen to record the GPS data (
What information do you need?
How can I help you?
Miguel Angel

Re: X,Y Resolution

Posted: Mon May 25, 2009 7:34 am
by xnview
dominique wrote:Do you have some news about EXIF X/Y resolution ?
I've sent a version to dominique for testing...

Re: X,Y Resolution

Posted: Mon May 25, 2009 8:16 am
by dominique
Testing OK ! Continue testing with other EXIF values.

Code: Select all

#define MY_EXIF_X_RESOLUTION                         0x011A
#define MY_EXIF_Y_RESOLUTION                         0x011B
gflBitmapSetEXIFValueRational2(GFL_EXIF_DATAEX* exif, GFL_EXIF_MAIN_IFD, MY_EXIF_X_RESOLUTION, 200, 1);     // For 200 dpi
gflBitmapSetEXIFValueRational2(GFL_EXIF_DATAEX* exif, GFL_EXIF_MAIN_IFD, MY_EXIF_Y_RESOLUTION, 200, 1);     // For 200 dpi
Good Job !
Thx Pierre

PS : for EXIF Tags values : ... /EXIF.html

Edit : Several modifications and it will be ok

Re: X,Y Resolution

Posted: Thu May 28, 2009 2:52 pm
by madiazg
Is it a new version of GFL SDK?
Do you have done tests with the GPS data?
Miguel Angel