Skip to content

Commit c40b0e5

Browse files
committed
fix some docs links
1 parent d4c432d commit c40b0e5

6 files changed

Lines changed: 33 additions & 29 deletions

File tree

docs/reference/ExifTags.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
The :py:mod:`ExifTags` module exposes two dictionaries which
88
provide constants and clear-text names for various well-known EXIF tags.
99

10-
.. py:class:: PIL.ExifTags.TAGS
10+
.. py:data:: TAGS
11+
:type: dict
1112

1213
The TAG dictionary maps 16-bit integer EXIF tag enumerations to
1314
descriptive string names. For instance:
@@ -16,7 +17,8 @@ provide constants and clear-text names for various well-known EXIF tags.
1617
>>> TAGS[0x010e]
1718
'ImageDescription'
1819

19-
.. py:class:: PIL.ExifTags.GPSTAGS
20+
.. py:data:: GPSTAGS
21+
:type: dict
2022

2123
The GPSTAGS dictionary maps 8-bit integer EXIF gps enumerations to
2224
descriptive string names. For instance:

docs/reference/ImageEnhance.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Classes
2929
All enhancement classes implement a common interface, containing a single
3030
method:
3131

32-
.. py:class:: PIL.ImageEnhance._Enhance
32+
.. py:class:: _Enhance
33+
3334
.. py:method:: enhance(factor)
3435
3536
Returns an enhanced image.
@@ -40,7 +41,7 @@ method:
4041
etc), and higher values more. There are no restrictions
4142
on this value.
4243

43-
.. py:class:: PIL.ImageEnhance.Color(image)
44+
.. py:class:: Color(image)
4445
4546
Adjust image color balance.
4647

@@ -49,23 +50,23 @@ method:
4950
factor of 0.0 gives a black and white image. A factor of 1.0 gives
5051
the original image.
5152

52-
.. py:class:: PIL.ImageEnhance.Contrast(image)
53+
.. py:class:: Contrast(image)
5354
5455
Adjust image contrast.
5556

5657
This class can be used to control the contrast of an image, similar
5758
to the contrast control on a TV set. An enhancement factor of 0.0
5859
gives a solid grey image. A factor of 1.0 gives the original image.
5960

60-
.. py:class:: PIL.ImageEnhance.Brightness(image)
61+
.. py:class:: Brightness(image)
6162
6263
Adjust image brightness.
6364

6465
This class can be used to control the brightness of an image. An
6566
enhancement factor of 0.0 gives a black image. A factor of 1.0 gives the
6667
original image.
6768

68-
.. py:class:: PIL.ImageEnhance.Sharpness(image)
69+
.. py:class:: Sharpness(image)
6970
7071
Adjust image sharpness.
7172

docs/reference/ImageStat.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
The :py:mod:`ImageStat` module calculates global statistics for an image, or
88
for a region of an image.
99

10-
.. py:class:: PIL.ImageStat.Stat(image_or_list, mask=None)
10+
.. py:class:: Stat(image_or_list, mask=None)
1111
1212
Calculate statistics for the given image. If a mask is included,
1313
only the regions covered by that mask are included in the
@@ -22,13 +22,13 @@ for a region of an image.
2222

2323
.. note::
2424

25-
This relies on the :py:meth:`~PIL.Image.histogram` method, and
25+
This relies on the :py:meth:`~PIL.Image.Image.histogram` method, and
2626
simply returns the low and high bins used. This is correct for
2727
images with 8 bits per channel, but fails for other modes such as
28-
``I`` or ``F``. Instead, use :py:meth:`~PIL.Image.getextrema` to
28+
``I`` or ``F``. Instead, use :py:meth:`~PIL.Image.Image.getextrema` to
2929
return per-band extrema for the image. This is more correct and
3030
efficient because, for non-8-bit modes, the histogram method uses
31-
:py:meth:`~PIL.Image.getextrema` to determine the bins used.
31+
:py:meth:`~PIL.Image.Image.getextrema` to determine the bins used.
3232

3333
.. py:attribute:: count
3434

docs/reference/JpegPresets.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
.. automodule:: PIL.JpegPresets
77

88
.. data:: presets
9-
:annotation:
9+
:type: dict
1010

11-
A dict of all supported presets.
11+
A dictionary of all supported presets.

docs/reference/TiffTags.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ metadata tag numbers, names, and type information.
1010
.. method:: lookup(tag)
1111

1212
:param tag: Integer tag number
13-
:returns: Taginfo namedtuple, From the ``TAGS_V2`` info if possible,
14-
otherwise just populating the value and name from ``TAGS``.
13+
:returns: Taginfo namedtuple, From the :py:data:`~PIL.TiffTags.TAGS_V2` info if possible,
14+
otherwise just populating the value and name from :py:data:`~PIL.TiffTags.TAGS`.
1515
If the tag is not recognized, "unknown" is returned for the name
1616

1717
.. versionadded:: 3.1.0
@@ -22,7 +22,7 @@ metadata tag numbers, names, and type information.
2222

2323
:param value: Integer Tag Number
2424
:param name: Tag Name
25-
:param type: Integer type from :py:attr:`PIL.TiffTags.TYPES`
25+
:param type: Integer type from :py:data:`PIL.TiffTags.TYPES`
2626
:param length: Array length: 0 == variable, 1 == single value, n = fixed
2727
:param enum: Dict of name:integer value options for an enumeration
2828

@@ -33,15 +33,17 @@ metadata tag numbers, names, and type information.
3333

3434
.. versionadded:: 3.0.0
3535

36-
.. py:attribute:: PIL.TiffTags.TAGS_V2
36+
.. py:data:: PIL.TiffTags.TAGS_V2
37+
:type: dict
3738

3839
The ``TAGS_V2`` dictionary maps 16-bit integer tag numbers to
39-
:py:class:`PIL.TagTypes.TagInfo` tuples for metadata fields defined in the TIFF
40+
:py:class:`PIL.TiffTags.TagInfo` tuples for metadata fields defined in the TIFF
4041
spec.
4142

4243
.. versionadded:: 3.0.0
4344

44-
.. py:attribute:: PIL.TiffTags.TAGS
45+
.. py:data:: PIL.TiffTags.TAGS
46+
:type: dict
4547

4648
The ``TAGS`` dictionary maps 16-bit integer TIFF tag number to
4749
descriptive string names. For instance:
@@ -50,10 +52,11 @@ metadata tag numbers, names, and type information.
5052
>>> TAGS[0x010e]
5153
'ImageDescription'
5254

53-
This dictionary contains a superset of the tags in TAGS_V2, common
55+
This dictionary contains a superset of the tags in :py:data:`~PIL.TiffTags.TAGS_V2`, common
5456
EXIF tags, and other well known metadata tags.
5557

56-
.. py:attribute:: PIL.TiffTags.TYPES
58+
.. py:data:: PIL.TiffTags.TYPES
59+
:type: dict
5760

5861
The ``TYPES`` dictionary maps the TIFF type short integer to a
5962
human readable type name.

src/PIL/ExifTags.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
# See the README file for information on usage and redistribution.
1010
#
1111

12-
##
13-
# This module provides constants and clear-text names for various
14-
# well-known EXIF tags.
15-
##
12+
"""
13+
This module provides constants and clear-text names for various
14+
well-known EXIF tags.
15+
"""
1616

17-
##
18-
# Maps EXIF tags to tag names.
1917

2018
TAGS = {
2119
# possibly incomplete
@@ -280,9 +278,8 @@
280278
0xC74E: "OpcodeList3",
281279
0xC761: "NoiseProfile",
282280
}
281+
"""Maps EXIF tags to tag names."""
283282

284-
##
285-
# Maps EXIF GPS tags to tag names.
286283

287284
GPSTAGS = {
288285
0: "GPSVersionID",
@@ -318,3 +315,4 @@
318315
30: "GPSDifferential",
319316
31: "GPSHPositioningError",
320317
}
318+
"""Maps EXIF GPS tags to tag names."""

0 commit comments

Comments
 (0)