okay, so i used a php script to read the app0 markers of four images used in this discussion. The output from this script comes first, then my programs output code follows.
two images using unit = 0. The first image has 0x64 values (100) and the second contains normal par values 1:1
00 | | 5
10 | | 6
4a | J | 7
46 | F | 8
49 | I | 9
46 | F | 10
00 | | 11
01 | | 12
02 | | 13
00 | | 14 unit
00 | | 15 xdensity
64 | d | 16 xdensity
00 | | 17 ydensity
64 | d | 18 ydensity
00 | | 19
00 | | 20
JFIF-Version 0102 (1.02)
Unit 0 = Pixel Aspect Ratio (par)
X Density 100
Y Density 100
X Thumbnail 0
Y Thumbnail 0
00 | | 5
10 | | 6
4a | J | 7
46 | F | 8
49 | I | 9
46 | F | 10
00 | | 11
01 | | 12
01 | | 13
00 | | 14 unit
00 | | 15 xdensity
01 | | 16 xdensity
00 | | 17 ydensity
01 | | 18 ydensity
00 | | 19
00 | | 20
JFIF-Version 0101 (1.01)
Unit 0 = Pixel Aspect Ratio (par)
X Density 1
Y Density 1
X Thumbnail 0
Y Thumbnail 0
the next two images contain unit = 2 or dots per centimeter but they contain hex values which are dots per inch values. (i think that i understand here that one byte is not enough to store a float value or numerator/denominator values. i guess that i should just multiply the values by 0.393701.)
00 | | 5
10 | | 6
4a | J | 7
46 | F | 8
49 | I | 9
46 | F | 10
00 | | 11
01 | | 12
01 | | 13
02 | | 14
00 | | 15
48 | H | 16
00 | | 17
48 | H | 18
00 | | 19
00 | | 20
JFIF-Version 0101 (1.01)
Unit 2 = Dots per centimeter (dpcm)
X Density 72
Y Density 72
X Thumbnail 0
Y Thumbnail 0
00 | | 5
10 | | 6
4a | J | 7
46 | F | 8
49 | I | 9
46 | F | 10
00 | | 11
01 | | 12
02 | | 13
02 | | 14
00 | | 15
c8 | | 16
00 | | 17
c8 | | 18
00 | | 19
00 | | 20
JFIF-Version 0102 (1.02)
Unit 2 = Dots per centimeter (dpcm)
X Density 200
Y Density 200
X Thumbnail 0
Y Thumbnail 0
so whenever i noticed the values in the par images, i decided to post here for tips. 100 par looks silly in my output. I assume that i am supposed to divide the two numbers but i am not sure about it now. I was thinking to leave the value encoded in the file, here 100 and use no suffix after that value since i describe the unit in the output.
thoughts? recommendations? is my included code helpful to you?