Skip to content

Commit cd55ccf

Browse files
committed
Clarify meaning of image resolution
1 parent 895b0a6 commit cd55ccf

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

docs/page.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,8 +1705,8 @@ In a nutshell, this is what you can do with PyMuPDF:
17051705
height original image height (``int``)
17061706
cs-name colorspace name (``str``)
17071707
colorspace colorspace.n (``int``)
1708-
xres resolution in x-direction (``int``)
1709-
yres resolution in y-direction (``int``)
1708+
xres resolution in x-direction (``int``) [#f10]_
1709+
yres resolution in y-direction (``int``) [#f10]_
17101710
bpc bits per component (``int``)
17111711
size storage occupied by image (``int``)
17121712
digest MD5 hashcode (``bytes``), if ``hashes`` is true
@@ -2360,4 +2360,6 @@ The page number "pno" is a 0-based integer `-∞ < pno < page_count`.
23602360
23612361
.. [#f9] Objects inside the source page, like images, text or drawings, are never aware of whether their owning page now is under OC control inside the target PDF. If source page objects are OC-controlled in the source PDF, then this will not be retained on the target: they will become unconditionally visible.
23622362
2363+
.. [#f10] This value is always 96, the default of the PDF interpreter. It **does not reflect** the resolution of the image itself. If you need the image's resolution, use the :meth:`Pixmap.xres` and :meth:`Pixmap.yres` attributes of the :ref:`Pixmap` created from the image binary.
2364+
23632365
.. include:: footer.rst

docs/textpage.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ ext image type (``str``), as file extension, see below
214214
width original image width (``int``)
215215
height original image height (``int``)
216216
colorspace colorspace component count (``int``)
217-
xres resolution in x-direction (``int``)
218-
yres resolution in y-direction (``int``)
217+
xres resolution in x-direction (``int``) [#f3]_
218+
yres resolution in y-direction (``int``) [#f3]_
219219
bpc bits per component (``int``)
220220
transform matrix transforming image rect to bbox (:data:`matrix_like`)
221221
size size of the image in bytes (``int``)
@@ -388,4 +388,6 @@ This image shows the relationship between a character's bbox and its quad: |text
388388
389389
.. [#f2] The coordinate systems of MuPDF and PDF are different in that MuPDF uses the page's top-left point as `(0, 0)`. In PDF, this is the bottom-left point. Therefore, the positive direction for MuPDF's y-axis is **from top to bottom**. This causes the sign change for the sine value here: a **negative** value indicates anti-clockwise rotation of the text.
390390
391+
.. [#f3] This value is always 96, the default of the PDF interpreter. It **does not reflect** the resolution of the image itself. If you need the image's resolution, use the :meth:`Pixmap.xres` and :meth:`Pixmap.yres` attributes of the :ref:`Pixmap` created from the returned image binary.
392+
391393
.. include:: footer.rst

0 commit comments

Comments
 (0)