Hello,
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?
Regards...
Miguel Angel
http://imagen3d.site88.net
X,Y Resolution
Moderators: XnTriq, helmut, xnview
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
-
- Posts: 72
- Joined: Thu Nov 08, 2007 9:22 am
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 : http://newsgroup.xnview.com/viewtopic.p ... light=exif
For other EXIF field : http://newsgroup.xnview.com/viewtopic.p ... light=exif
Dom
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Hello Dom
In the EXIF data, Xdpi and Ydpi are datas type Rational.
I tried to save these data as follows:
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?
Regards...
Miguel Angel
http://imagen3d.site88.net
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
To DPI = 200, what values of P and Q should I indicate in gflBitmapSetEXIFValueRational2?
Regards...
Miguel Angel
http://imagen3d.site88.net
-
- Posts: 72
- Joined: Thu Nov 08, 2007 9:22 am
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Hello DOM
according to the information I have obtained:
XResolution
The number of pixels per ResolutionUnit in the ImageWidth direction. When the image resolution is unknown, 72
[dpi] is designated.
Tag = 282 (11A.H)
Type = RATIONAL
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!
Regards...
Miguel Angel
http://imagen3d.site88.net
according to the information I have obtained:
XResolution
The number of pixels per ResolutionUnit in the ImageWidth direction. When the image resolution is unknown, 72
[dpi] is designated.
Tag = 282 (11A.H)
Type = RATIONAL
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!
Regards...
Miguel Angel
http://imagen3d.site88.net
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
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:
Tag:282
ifd:1
NComp:1
Value:0
DLengt:8
Data:.......
If I save the EXIF information:
I get the followings datas:
Tag:282
ifd:1
NComp:2
Value:0
DLength:16
Data: .....
procedure gflBitmapSetEXIFValueRational2(exif: PGFL_EXIF_DATAEX; ifd, tag: GFL_UINT16; p,q: GFL_UINT32); stdcall;
do you find some explanation?
Regards...
Miguel Angel
http://imagen3d.site88.net
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:
Tag:282
ifd:1
NComp:1
Value:0
DLengt:8
Data:.......
If I save the EXIF information:
Code: Select all
gflBitmapSetEXIFValueRational2(EXIF2, 1, 282, 72, 1);
Tag:282
ifd:1
NComp:2
Value:0
DLength:16
Data: .....
procedure gflBitmapSetEXIFValueRational2(exif: PGFL_EXIF_DATAEX; ifd, tag: GFL_UINT16; p,q: GFL_UINT32); stdcall;
do you find some explanation?
Regards...
Miguel Angel
http://imagen3d.site88.net
-
- Posts: 72
- Joined: Thu Nov 08, 2007 9:22 am
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Re: X,Y Resolution
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 (http://newsgroup.xnview.com/viewtopic.php?f=4&t=16903).
What information do you need?
How can I help you?
Regards...
Miguel Angel
http://imagen3d.site88.net
What information do you need?
How can I help you?
Regards...
Miguel Angel
http://imagen3d.site88.net
-
- Author of XnView
- Posts: 39816
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: X,Y Resolution
I've sent a version to dominique for testing...dominique wrote:Do you have some news about EXIF X/Y resolution ?
Pierre.
-
- Posts: 72
- Joined: Thu Nov 08, 2007 9:22 am
Re: X,Y Resolution
Testing OK ! Continue testing with other EXIF values.
Good Job !
Thx Pierre
PS : for EXIF Tags values : http://www.sno.phy.queensu.ca/~phil/exi ... /EXIF.html
Edit : Several modifications and it will be ok
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
Thx Pierre
PS : for EXIF Tags values : http://www.sno.phy.queensu.ca/~phil/exi ... /EXIF.html
Edit : Several modifications and it will be ok
Dom
-
- Posts: 82
- Joined: Wed Jul 18, 2007 8:00 pm
- Location: Tenerife - Islas Canarias
Re: X,Y Resolution
Is it a new version of GFL SDK?
Do you have done tests with the GPS data?
Regards...
Miguel Angel
http://imagen3d.site88.net
Do you have done tests with the GPS data?
Regards...
Miguel Angel
http://imagen3d.site88.net