From 0b278f33760b29fc597a16189a0c993a87614e60 Mon Sep 17 00:00:00 2001 From: Michael Nagy Date: Sat, 12 Jul 2014 10:44:27 -0500 Subject: [PATCH 1/5] Added docs for previously-undocumented ExifTags module. --- docs/reference/ExifTags.rst | 26 ++++++++++++++++++++++++++ docs/reference/index.rst | 1 + 2 files changed, 27 insertions(+) create mode 100644 docs/reference/ExifTags.rst diff --git a/docs/reference/ExifTags.rst b/docs/reference/ExifTags.rst new file mode 100644 index 000000000..9fc7cd13b --- /dev/null +++ b/docs/reference/ExifTags.rst @@ -0,0 +1,26 @@ +.. py:module:: PIL.ExifTags +.. py:currentmodule:: PIL.ExifTags + +:py:mod:`ExifTags` Module +========================== + +The :py:mod:`ExifTags` module exposes two dictionaries which +provide constants and clear-text names for various well-known EXIF tags. + +.. py:class:: PIL.ExifTags.TAGS + + The TAG dictionary maps 16-bit integer EXIF tag enumerations to + descriptive string names. For instance: + + >>> from PIL.ExifTags import TAGS + >>> TAGS[0x010e] + 'ImageDescription' + +.. py:class:: PIL.ExifTags.GPSTAGS + + The GPSTAGS dictionary maps 8-bit integer EXIF gps enumerations to + descriptive string names. For instance: + + >>> from PIL.ExifTags import GPSTAGS + >>> GPSTAGS[20] + 'GPSDestLatitude' diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 2d57e37be..563e03acf 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -4,6 +4,7 @@ Reference .. toctree:: :maxdepth: 2 + ExifTags Image ImageChops ImageColor From c9fccf8ba8ce919766070778f7084cba282a95e6 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sat, 12 Jul 2014 09:35:38 -0700 Subject: [PATCH 2/5] Reducing priority of exiftags docs --- docs/reference/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 563e03acf..66310e3e7 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -4,7 +4,7 @@ Reference .. toctree:: :maxdepth: 2 - ExifTags + Image ImageChops ImageColor @@ -23,5 +23,6 @@ Reference ImageStat ImageTk ImageWin + ExifTags PSDraw ../PIL From 8edab8b9393a2199fc3e7dcb358d01bb3d11c2f3 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sat, 12 Jul 2014 09:37:27 -0700 Subject: [PATCH 3/5] Removed autodoc for ExifTag --- docs/PIL.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/PIL.rst b/docs/PIL.rst index 6726f661f..0a6ccd62a 100644 --- a/docs/PIL.rst +++ b/docs/PIL.rst @@ -20,14 +20,6 @@ can be found here. :undoc-members: :show-inheritance: -:mod:`ExifTags` Module ----------------------- - -.. automodule:: PIL.ExifTags - :members: - :undoc-members: - :show-inheritance: - :mod:`FontFile` Module ---------------------- From 5d3f8343852ca9c7fefe913f2f1ef1b6d936ab19 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sat, 12 Jul 2014 09:41:34 -0700 Subject: [PATCH 4/5] including ImageMorph autodoc --- docs/PIL.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/PIL.rst b/docs/PIL.rst index 0a6ccd62a..3b4706511 100644 --- a/docs/PIL.rst +++ b/docs/PIL.rst @@ -78,6 +78,14 @@ can be found here. :undoc-members: :show-inheritance: +:mod:`ImageMorph` Module +------------------------ + +.. automodule:: PIL.ImageMorph + :members: + :undoc-members: + :show-inheritance: + :mod:`ImageShow` Module ----------------------- From b6b36543ceb8d3e7dc9cb5e2b5d5181795eb625e Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sat, 12 Jul 2014 09:52:04 -0700 Subject: [PATCH 5/5] Autodoc formatting --- PIL/ImageMorph.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/PIL/ImageMorph.py b/PIL/ImageMorph.py index b24dd134f..3f15621a6 100644 --- a/PIL/ImageMorph.py +++ b/PIL/ImageMorph.py @@ -15,19 +15,19 @@ LUT_SIZE = 1 << 9 class LutBuilder: """A class for building a MorphLut from a descriptive language - The input patterns is a list of a strings sequences like these: + The input patterns is a list of a strings sequences like these:: - 4:(... - .1. - 111)->1 + 4:(... + .1. + 111)->1 (whitespaces including linebreaks are ignored). The option 4 describes a series of symmetry operations (in this case a 4-rotation), the pattern is described by: - . or X - Ignore - 1 - Pixel is on - 0 - Pixel is off + - . or X - Ignore + - 1 - Pixel is on + - 0 - Pixel is off The result of the operation is described after "->" string. @@ -35,15 +35,16 @@ class LutBuilder: returned if no other match is found. Operations: - 4 - 4 way rotation - N - Negate - 1 - Dummy op for no other operation (an op must always be given) - M - Mirroring + + - 4 - 4 way rotation + - N - Negate + - 1 - Dummy op for no other operation (an op must always be given) + - M - Mirroring - Example: - - lb = LutBuilder(patterns = ["4:(... .1. 111)->1"]) - lut = lb.build_lut() + Example:: + + lb = LutBuilder(patterns = ["4:(... .1. 111)->1"]) + lut = lb.build_lut() """ def __init__(self, patterns=None, op_name=None):