Home » Questions » Computers [ Ask a new question ]

Tiff headers and bit-order

Tiff headers and bit-order

Am I correct in understanding that bytes 0-1 represent two 8-bit values, bytes 2-3 are a 16-number, and that bytes 4-7 are a 32-bit number?

Asked by: Guest | Views: 223
Total answers/comments: 1
Guest [Entry]

"Bytes 0-1 represent two 8-bit values>

yes
bytes 2-3 are a 16-number?
Yes, it should be a 16-value that represents 42 in the order expected from the first two bytes
and, that bytes 4-7 are a 32-bit number
yes. Its value is to be interpreted correctly based on the endian-ness confirmed earlier.

The little-endian start,

0x49 0x49 0x2A 0x00 0x67 0x45 0x23 0x01 ...
---- ---- --------- -------------------

Can be represented in big-endian as,

0x4D 0x4D 0x00 0x2A 0x01 0x23 0x45 0x67 ...
---- ---- --------- -------------------

Where the word has value 19088743.

Maybe this code reference will help you get it better.
Also, note my earlier comment on byte-sequences and words in the other answer..."