From cd10404abb725c2b84a5265ada1e499e8d4d95ae Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 14 Jul 2020 22:18:25 +1000 Subject: [PATCH 1/4] Corrected reference --- docs/handbook/image-file-formats.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/handbook/image-file-formats.rst b/docs/handbook/image-file-formats.rst index 0355e1d18..bd565f79c 100644 --- a/docs/handbook/image-file-formats.rst +++ b/docs/handbook/image-file-formats.rst @@ -712,8 +712,8 @@ The :py:meth:`~PIL.Image.open` method sets the following attributes: **n_frames** Set to the number of images in the stack. -A convenience method, :py:meth:`~PIL.Image.Image.convert2byte`, is provided for -converting floating point data to byte data (mode ``L``):: +A convenience method, :py:meth:`~PIL.SpiderImagePlugin.SpiderImageFile.convert2byte`, +is provided for converting floating point data to byte data (mode ``L``):: im = Image.open('image001.spi').convert2byte() From 470bf71e7af7f9bde20fbf1f4acd78cb63988471 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 14 Jul 2020 22:23:57 +1000 Subject: [PATCH 2/4] Removed domain references from image expressions --- docs/reference/ImageMath.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/reference/ImageMath.rst b/docs/reference/ImageMath.rst index 21308b339..821f60cf5 100644 --- a/docs/reference/ImageMath.rst +++ b/docs/reference/ImageMath.rst @@ -60,9 +60,8 @@ point values, as necessary. For example, if you add two 8-bit images, the result will be a 32-bit integer image. If you add a floating point constant to an 8-bit image, the result will be a 32-bit floating point image. -You can force conversion using the :py:func:`~PIL.ImageMath.convert`, -:py:func:`~PIL.ImageMath.float`, and :py:func:`~PIL.ImageMath.int` functions -described below. +You can force conversion using the ``convert()``, ``float()``, and ``int()`` +functions described below. Bitwise Operators ^^^^^^^^^^^^^^^^^ From 45564fe89d7db4b819ecb8a93457a6a5129cbe51 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 14 Jul 2020 22:20:44 +1000 Subject: [PATCH 3/4] Removed domain references when referring to hypothetical code --- docs/conf.py | 7 ------- docs/handbook/writing-your-own-file-decoder.rst | 16 ++++++++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 615afe715..2d80e3170 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -115,17 +115,10 @@ nitpicky = True # if present. Example entries would be ('py:func', 'int') or # ('envvar', 'LD_LIBRARY_PATH'). nitpick_ignore = [ - ("py:meth", "_open"), - ("py:attr", "tile"), - ("py:meth", "CDC.GetHandleAttrib"), - ("py:meth", "PIL.Image.Image.convert2byte"), ("py:attr", "PIL.Image.Image.tag"), ("py:attr", "PIL.Image.Image.tag_v2"), ("py:attr", "PIL.Image.Image.tile"), ("py:data", "PIL.Image.MAX_IMAGE_PIXELS"), - ("py:func", "PIL.ImageMath.convert"), - ("py:func", "PIL.ImageMath.float"), - ("py:func", "PIL.ImageMath.int"), ("py:attr", "PIL.TiffImagePlugin.ImageFileDirectory_v2.tagtype"), ] diff --git a/docs/handbook/writing-your-own-file-decoder.rst b/docs/handbook/writing-your-own-file-decoder.rst index c73ad9cab..471ae3377 100644 --- a/docs/handbook/writing-your-own-file-decoder.rst +++ b/docs/handbook/writing-your-own-file-decoder.rst @@ -28,16 +28,16 @@ Pillow decodes files in two stages: An image plugin should contain a format handler derived from the :py:class:`PIL.ImageFile.ImageFile` base class. This class should -provide an :py:meth:`_open` method, which reads the file header and +provide an ``_open`` method, which reads the file header and sets up at least the :py:attr:`~PIL.Image.Image.mode` and :py:attr:`~PIL.Image.Image.size` attributes. To be able to load the -file, the method must also create a list of :py:attr:`tile` -descriptors, which contain a decoder name, extents of the tile, and +file, the method must also create a list of ``tile`` descriptors, +which contain a decoder name, extents of the tile, and any decoder-specific data. The format handler class must be explicitly registered, via a call to the :py:mod:`~PIL.Image` module. .. note:: For performance reasons, it is important that the - :py:meth:`_open` method quickly rejects files that do not have the + ``_open`` method quickly rejects files that do not have the appropriate contents. Example @@ -103,10 +103,10 @@ Note that the image plugin must be explicitly registered using :py:func:`PIL.Image.register_open`. Although not required, it is also a good idea to register any extensions used by this format. -The :py:attr:`tile` attribute ------------------------------ +The ``tile`` attribute +---------------------- -To be able to read the file as well as just identifying it, the :py:attr:`tile` +To be able to read the file as well as just identifying it, the ``tile`` attribute must also be set. This attribute consists of a list of tile descriptors, where each descriptor specifies how data should be loaded to a given region in the image. In most cases, only a single descriptor is used, @@ -134,7 +134,7 @@ The fields are used as follows: decoder specified by the first field in the tile descriptor tuple. If the decoder doesn’t need any parameters, use :data:`None` for this field. -Note that the :py:attr:`tile` attribute contains a list of tile descriptors, +Note that the ``tile`` attribute contains a list of tile descriptors, not just a single descriptor. Decoders From f454b242889d62982c898f6a5519269818005611 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 14 Jul 2020 22:37:03 +1000 Subject: [PATCH 4/4] Removed domain reference for external method --- src/PIL/ImageWin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PIL/ImageWin.py b/src/PIL/ImageWin.py index afba61c32..2ca4acdf8 100644 --- a/src/PIL/ImageWin.py +++ b/src/PIL/ImageWin.py @@ -88,8 +88,8 @@ class Dib: Copy the bitmap contents to a device context. :param handle: Device context (HDC), cast to a Python integer, or an - HDC or HWND instance. In PythonWin, you can use the - :py:meth:`CDC.GetHandleAttrib` to get a suitable handle. + HDC or HWND instance. In PythonWin, you can use + ``CDC.GetHandleAttrib()`` to get a suitable handle. """ if isinstance(handle, HWND): dc = self.image.getdc(handle)