GPHemsley / tiff-js

A JavaScript-based parser for the TIFF image format.
Mozilla Public License 2.0
71 stars 30 forks source link

Support sub-byte bitsPerSample #2

Open GPHemsley opened 11 years ago

GPHemsley commented 11 years ago

The size of a sample is stored in bitsPerSample, which allows sub-byte values (i.e. values not divisible by 8). As a result, sample data could span byte boundaries.

Since many images use this method (it allows for smaller files), we need to support this. However, it will require fancy handling, because DataView only allows reading a minimum of one byte at a time.