Skip to content

Commit

Permalink
Fix tiff reader leaking file handles (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
Justus H committed Aug 12, 2020
1 parent 16721ff commit fff06db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/types/tiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function readIFD(buffer: Buffer, filepath: string, isBigEndian: boolean) {
const endBuffer = Buffer.alloc(bufferSize)
const descriptor = fs.openSync(filepath, 'r')
fs.readSync(descriptor, endBuffer, 0, bufferSize, ifdOffset)
fs.closeSync(descriptor)

return endBuffer.slice(2)
}
Expand Down

0 comments on commit fff06db

Please sign in to comment.