MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / shrink

Method shrink

src/__init__.py:14053–14062  ·  view source on GitHub ↗

Divide width and height by 2**factor. E.g. factor=1 shrinks to 25% of original size (in place).

(self, factor)

Source from the content-addressed store, hash-verified

14051 return rc
14052
14053 def shrink(self, factor):
14054 """Divide width and height by 2**factor.
14055 E.g. factor=1 shrinks to 25% of original size (in place)."""
14056 if factor < 1:
14057 message_warning("ignoring shrink factor < 1")
14058 return
14059 mupdf.fz_subsample_pixmap( self.this, factor)
14060 # Pixmap has changed so clear our memory view.
14061 self._memory_view = None
14062 self._samples_mv_release()
14063
14064 @property
14065 def size(self):

Callers

nothing calls this directly

Calls 2

_samples_mv_releaseMethod · 0.95
message_warningFunction · 0.85

Tested by

no test coverage detected