Skip to content

Commit

Permalink
fix: correctly decode images from pooled buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Oct 29, 2021
1 parent 3a06d23 commit fcbbc34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/__tests__/decode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ interface TiffFile {
}

const files: TiffFile[] = [
// TODO: Unsupported LZW compression?
// 'color-1px.tif',
{
name: 'color-1px.tif',
width: 1,
height: 1,
bitsPerSample: 8,
components: 3,
},
{
name: 'color8.tif',
width: 160,
Expand Down
2 changes: 1 addition & 1 deletion src/tiffDecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default class TIFFDecoder extends IOBuffer {
for (let i = 0; i < stripOffsets.length; i++) {
let stripData = new DataView(
this.buffer,
stripOffsets[i],
this.byteOffset + stripOffsets[i],
stripByteCounts[i],
);

Expand Down

0 comments on commit fcbbc34

Please sign in to comment.