Skip to content

Commit

Permalink
Merge pull request #1070 from kmike/doc-fixes
Browse files Browse the repository at this point in the history
Minor doc fixes
  • Loading branch information
wiredfool committed Jan 7, 2015
2 parents e8e2482 + 6850430 commit ede3e81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ def frombytes(mode, size, data, decoder_name="raw", *args):
You can also use any pixel decoder supported by PIL. For more
information on available decoders, see the section
**Writing Your Own File Decoder**.
:ref:`Writing Your Own File Decoder <file-decoders>`.
Note that this function decodes pixel data only, not entire images.
If you have an entire image in a string, wrap it in a
Expand Down
10 changes: 6 additions & 4 deletions docs/handbook/writing-your-own-file-decoder.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Writing your own file decoder
.. _file-decoders:

Writing Your Own File Decoder
=============================

The Python Imaging Library uses a plug-in model which allows you to
Expand All @@ -7,7 +9,7 @@ library itself. Such plug-ins usually have names like
:file:`XxxImagePlugin.py`, where ``Xxx`` is a unique format name
(usually an abbreviation).

.. warning:: Pillow >= 2.1.0 no longer automatically imports any file in the Python path with a name ending in :file:`ImagePlugin.py`. You will need to import your decoder manually.
.. warning:: Pillow >= 2.1.0 no longer automatically imports any file in the Python path with a name ending in :file:`ImagePlugin.py`. You will need to import your decoder manually.

A decoder plug-in should contain a decoder class, based on the
:py:class:`PIL.ImageFile.ImageFile` base class. This class should provide an
Expand Down Expand Up @@ -68,7 +70,7 @@ true color.
]

Image.register_open("SPAM", SpamImageFile)

Image.register_extension("SPAM", ".spam")
Image.register_extension("SPAM", ".spa") # dos version

Expand Down Expand Up @@ -125,7 +127,7 @@ TIFF, and many others. To use the raw decoder with the
:py:func:`PIL.Image.fromstring` function, use the following syntax::

image = Image.fromstring(
mode, size, data, "raw",
mode, size, data, "raw",
raw mode, stride, orientation
)

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/ImagePath.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ vector data. Path objects can be passed to the methods on the
Converts the path to a Python list [(x, y), …].

:param flat: By default, this function returns a list of 2-tuples
[(x, y), ...]. If this argument is :keyword:`True`, it
[(x, y), ...]. If this argument is `True`, it
returns a flat list [x, y, ...] instead.
:return: A list of coordinates. See **flat**.

Expand Down

0 comments on commit ede3e81

Please sign in to comment.