Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/reference/ImageColor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ The ImageColor module supports the following string formats:
Functions
---------

.. py:method:: getrgb(color)
.. py:function:: getrgb(color)

Convert a color string to an RGB tuple. If the string cannot be parsed,
this function raises a :py:exc:`ValueError` exception.

.. versionadded:: 1.1.4

.. py:method:: getcolor(color, mode)
.. py:function:: getcolor(color, mode)

Same as :py:func:`~PIL.ImageColor.getrgb`, but converts the RGB value to a
grayscale value if the mode is not color or a palette image. If the string
Expand Down
6 changes: 3 additions & 3 deletions docs/releasenotes/10.2.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ the user, rather than always being calculated by Pillow.
Optimized ImageColor.getrgb and getcolor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The color calculations of :py:attr:`~PIL.ImageColor.getrgb` and
:py:attr:`~PIL.ImageColor.getcolor` are now cached using
The color calculations of :py:func:`~PIL.ImageColor.getrgb` and
:py:func:`~PIL.ImageColor.getcolor` are now cached using
:py:func:`functools.lru_cache`. Cached calls of ``getrgb`` are 3.1 - 91.4 times
as fast and ``getcolor`` are 5.1 - 19.6 times as fast.

Optimized ImageMode.getmode
^^^^^^^^^^^^^^^^^^^^^^^^^^^

The lookups made by :py:attr:`~PIL.ImageMode.getmode` are now cached using
The lookups made by :py:func:`~PIL.ImageMode.getmode` are now cached using
:py:func:`functools.lru_cache` instead of a custom cache. Cached calls are 1.2 times as
fast.

Expand Down
2 changes: 1 addition & 1 deletion docs/releasenotes/8.3.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Security
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Avoid a potential ReDoS (regular expression denial of service) in :py:class:`~PIL.ImageColor`'s
:py:meth:`~PIL.ImageColor.getrgb` by raising :py:exc:`ValueError` if the color specifier is
:py:func:`~PIL.ImageColor.getrgb` by raising :py:exc:`ValueError` if the color specifier is
too long. Present since Pillow 5.2.0.

Fix 6-byte out-of-bounds (OOB) read
Expand Down