Skip to content

Commit

Permalink
bugfix: Convert - patch writer. Fix TIFF metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
torzdf committed Jan 7, 2024
1 parent b72b730 commit 2a38451
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,9 @@ def tiff_read_meta(image: bytes) -> dict[str, T.Any]:

num_tags = struct.unpack("<H", image[ptr: ptr + 2])[0]
ptr += 2
ifd = image[ptr: ptr + num_tags * 12:]
next_ifd = struct.unpack("<I", image[ptr + num_tags * 12:4])[0]
ifd_end = ptr + num_tags * 12
ifd = image[ptr: ifd_end]
next_ifd = struct.unpack("<I", image[ifd_end:ifd_end + 4])[0]
assert next_ifd == 0, "Multi-page TIFF files not supported"

dtypes = {2: "1s", 3: "1H", 4: "1I", 7: '1B'}
Expand Down

0 comments on commit 2a38451

Please sign in to comment.