Skip to content

Commit

Permalink
src/__init__.py: fix use of fz_compressed_image_buffer() with mupdf-1…
Browse files Browse the repository at this point in the history
….23.x.
  • Loading branch information
julian-smith-artifex-com committed Feb 12, 2024
1 parent 0a835f6 commit d7d5937
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12597,10 +12597,15 @@ def extractIMGINFO(self, hashes=0):
continue
img = block.i_image()
img_size = 0
compr_buff = mupdf.fz_compressed_image_buffer(img)
if compr_buff:
img_size = compr_buff.fz_compressed_buffer_size()
compr_buff = None
if mupdf_version_tuple >= (1, 24):
compr_buff = mupdf.fz_compressed_image_buffer(img)
if compr_buff:
img_size = compr_buff.fz_compressed_buffer_size()
compr_buff = None
else:
compr_buff = mupdf.ll_fz_compressed_image_buffer(img.m_internal)
if compr_buff:
img_size = mupdf.ll_fz_compressed_buffer_size(compr_buff)
if hashes:
r = mupdf.FzIrect(FZ_MIN_INF_RECT, FZ_MIN_INF_RECT, FZ_MAX_INF_RECT, FZ_MAX_INF_RECT)
assert mupdf.fz_is_infinite_irect(r)
Expand Down

0 comments on commit d7d5937

Please sign in to comment.