Skip to content

Commit

Permalink
fix: buffer start offset (#11)
Browse files Browse the repository at this point in the history
* Fix start offset

* Fix exifIDF offset
  • Loading branch information
Friendseeker authored Sep 20, 2024
1 parent 169f4a9 commit 472cc73
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/markers/exif.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,12 @@ class IDFEntries {
return {};
}

const entries = this._decodeIDFEntries(buffer, tags.ifd, offsetToFirstIFD);
const firstIFDBuffer = buffer.slice(offsetToFirstIFD - 8);
const entries = this._decodeIDFEntries(firstIFDBuffer, tags.ifd, offsetToFirstIFD);
const { exifIFDPointer, gpsInfoIFDPointer } = entries;

if (exifIFDPointer) {
buffer = buffer.slice(exifIFDPointer - offsetToFirstIFD);
buffer = buffer.slice(exifIFDPointer - 8);
entries.subExif = this._decodeIDFEntries(
buffer,
tags.ifd,
Expand Down

0 comments on commit 472cc73

Please sign in to comment.