Skip to content

Commit

Permalink
Corrected length of main IFDs
Browse files Browse the repository at this point in the history
  • Loading branch information
jabriffa committed Jun 14, 2018
1 parent 2f7aa53 commit 6a1119c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyshared/jbtiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def get_memorymap_directory(IFD, prefix, parent=0):
# if this was a subdirectory, recurse
if isinstance(values, dict):
# add directory to memory map
length = 2+len(values)*12
length = 2+len(values)*12 # must be a leaf
mmap += tiff_file.get_memorymap_directory(values, this_item, tag)
else:
# data segment length
Expand All @@ -811,8 +811,8 @@ def get_memorymap(self):
# work through all IFDs
for k, (IFD, ifd_offset, strips) in enumerate(self.data):
this_ifd = "IFD#%d" % k
# add entry for the directory itself
mmap.append((ifd_offset, 2+len(IFD)*12, this_ifd))
# add entry for the directory itself (not a leaf)
mmap.append((ifd_offset, 2+len(IFD)*12+4, this_ifd))
# add content of IFD
mmap += tiff_file.get_memorymap_directory(IFD, this_ifd)
# add data strips if present
Expand Down

0 comments on commit 6a1119c

Please sign in to comment.