Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

how to get the file header size of tiff image?
I need this value for data processing.

share|improve this question
    
Including the tags or just the header? –  Synetech Mar 12 '11 at 6:11
    
I guess it is just the header. –  hui Mar 12 '11 at 9:01
    
You want to use in in your program? Which language? –  M'vy Mar 12 '11 at 9:34
    
.OPERATION: CP FROM RAW .EXISTING RAW FILE: INP000 [Enter name of input file.] .ENTER BITS / PIXEL IN INPUT IMAGE (8, 16, 32 or -32): 16 [Enter bits used for each pixel in input file. The 32 bit input is assumed to be floating point! An entry of -32 will read floating point data and flip the byte ordering to compensate for different "endedness" of data.] .ENTER COLUMNS, ROWS & SLICES: 64 64 64 [Enter columns, rows, and slices in input file.] –  hui Mar 12 '11 at 10:13
    
ENTER HEADER BYTES TO BE SKIPPED: 512 [Enter bytes in input file header that should be skipped.] If the input file has 16 bits / pixel the following two questions will appear. If you are unsure of the correct answers try all four possible combinations and examine the output images to see which one is correct: –  hui Mar 12 '11 at 10:15

1 Answer 1

The header is 8 bytes:

+------------------------------------------------------------------------+
|                            TIFF Header                                 |
+--------+-------+----------+--------------------------------------------+
| Offset | Type  | Default  | Description                                |
+--------+-------+----------+--------------------------------------------+
| 0-1    | WORD  | II or MM | Endian: Intel (little) / Motorola (big)    |
| 2-3    | WORD  | 0x2A     | Version (usually 42)                       |
| 4-7    | ULONG |          | Offset to first IFD (image file directory) |
+--------+-------+----------+--------------------------------------------+

Here’s several references:

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.