From 22ce5cc0c7cf9129cd74be8a6b22fb8be8a79f1d Mon Sep 17 00:00:00 2001 From: nulano Date: Tue, 2 Jul 2019 11:08:48 +0200 Subject: [PATCH 1/4] Revert "Update epsilon for FreeType 2.10 with eg. Unicode width 16" --- Tests/test_imagefont.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 34ddbd53b..5532750fe 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -53,8 +53,7 @@ class TestImageFont(PillowTestCase): # (and, other things, but first things first) METRICS = { (">=2.3", "<2.4"): {"multiline": 30, "textsize": 12, "getters": (13, 16)}, - (">=2.7", "<2.10"): {"multiline": 6.2, "textsize": 2.5, "getters": (12, 16)}, - (">=2.10",): {"multiline": 14.8, "textsize": 2.5, "getters": (12, 16)}, + (">=2.7",): {"multiline": 6.2, "textsize": 2.5, "getters": (12, 16)}, "Default": {"multiline": 0.5, "textsize": 0.5, "getters": (12, 16)}, } From d7c69ea2b461f1c4305888934013edd5278f8ffb Mon Sep 17 00:00:00 2001 From: nulano Date: Tue, 2 Jul 2019 11:14:09 +0200 Subject: [PATCH 2/4] skip test_unicode_extended on Python 2.x --- Tests/test_imagefont.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 5532750fe..ee630a556 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -463,10 +463,7 @@ class TestImageFont(PillowTestCase): with self.assertRaises(UnicodeEncodeError): font.getsize(u"’") - @unittest.skipIf( - sys.platform.startswith("win32") and sys.version.startswith("2"), - "requires Python 3.x on Windows", - ) + @unittest.skipIf(sys.version.startswith("2"), "requires Python 3.3+") def test_unicode_extended(self): # issue #3777 text = u"A\u278A\U0001F12B" From d8594041b5b37ed6b2109e61006b0bb40748b0b8 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 6 Jul 2019 16:37:57 -0700 Subject: [PATCH 3/4] Remove empty, unused directory docs/_static --- MANIFEST.in | 1 - docs/Guardfile | 1 - docs/_static/.gitignore | 1 - docs/conf.py | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 docs/_static/.gitignore diff --git a/MANIFEST.in b/MANIFEST.in index c421a7bd4..79f4e2adb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -14,7 +14,6 @@ graft src graft depends graft winbuild graft docs -prune docs/_static # build/src control detritus exclude .appveyor.yml diff --git a/docs/Guardfile b/docs/Guardfile index f8f3051ed..5055d0aa5 100755 --- a/docs/Guardfile +++ b/docs/Guardfile @@ -4,7 +4,6 @@ from livereload.compiler import shell Task.add('*.rst', shell('make html')) Task.add('*/*.rst', shell('make html')) -Task.add('_static/*.css', shell('make clean html')) Task.add('_templates/*', shell('make clean html')) Task.add('Makefile', shell('make html')) Task.add('conf.py', shell('make html')) diff --git a/docs/_static/.gitignore b/docs/_static/.gitignore deleted file mode 100644 index b1f9a2ade..000000000 --- a/docs/_static/.gitignore +++ /dev/null @@ -1 +0,0 @@ -# Empty file, to make the directory available in the repository diff --git a/docs/conf.py b/docs/conf.py index 0eb137daa..c392b3524 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -139,7 +139,7 @@ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static", "resources"] +html_static_path = ["resources"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied From 8fac23b3dfaa7e067f30be06de7926ca9c47c5e9 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Sat, 6 Jul 2019 17:12:09 -0700 Subject: [PATCH 4/4] Clean up several Sphinx warnings Appeared as: Pillow/docs/reference/ImageDraw.rst:137: WARNING: Unexpected indentation. Pillow/docs/reference/ImageDraw.rst:164: WARNING: Unexpected indentation. Pillow/docs/reference/ImageDraw.rst:177: WARNING: Unexpected indentation. Pillow/docs/reference/ImageDraw.rst:208: WARNING: Unexpected indentation. Pillow/docs/reference/ImageStat.rst:24: WARNING: Explicit markup ends without a blank line; unexpected unindent. --- docs/reference/ImageDraw.rst | 30 +++++++++++++++--------------- docs/reference/ImageStat.rst | 13 +++++++------ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst index cd44cd6e9..5fac7914b 100644 --- a/docs/reference/ImageDraw.rst +++ b/docs/reference/ImageDraw.rst @@ -132,11 +132,11 @@ Methods Draws an arc (a portion of a circle outline) between the start and end angles, inside the given bounding box. - :param xy: Two points to define the bounding box. Sequence of - ``[(x0, y0), (x1, y1)]`` or ``[x0, y0, x1, y1]``, - where ``x1 >= x0`` and ``y1 >= y0``. - :param start: Starting angle, in degrees. Angles are measured from - 3 o'clock, increasing clockwise. + :param xy: Two points to define the bounding box. Sequence of ``[(x0, y0), + (x1, y1)]`` or ``[x0, y0, x1, y1]``, where ``x1 >= x0`` and ``y1 >= + y0``. + :param start: Starting angle, in degrees. Angles are measured from 3 + o'clock, increasing clockwise. :param end: Ending angle, in degrees. :param fill: Color to use for the arc. :param width: The line width, in pixels. @@ -159,9 +159,9 @@ Methods Same as :py:meth:`~PIL.ImageDraw.ImageDraw.arc`, but connects the end points with a straight line. - :param xy: Two points to define the bounding box. Sequence of - ``[(x0, y0), (x1, y1)]`` or ``[x0, y0, x1, y1]``, - where ``x1 >= x0`` and ``y1 >= y0``. + :param xy: Two points to define the bounding box. Sequence of ``[(x0, y0), + (x1, y1)]`` or ``[x0, y0, x1, y1]``, where ``x1 >= x0`` and ``y1 >= + y0``. :param outline: Color to use for the outline. :param fill: Color to use for the fill. :param width: The line width, in pixels. @@ -173,8 +173,8 @@ Methods Draws an ellipse inside the given bounding box. :param xy: Two points to define the bounding box. Sequence of either - ``[(x0, y0), (x1, y1)]`` or ``[x0, y0, x1, y1]``, - where ``x1 >= x0`` and ``y1 >= y0``. + ``[(x0, y0), (x1, y1)]`` or ``[x0, y0, x1, y1]``, where ``x1 >= x0`` + and ``y1 >= y0``. :param outline: Color to use for the outline. :param fill: Color to use for the fill. :param width: The line width, in pixels. @@ -203,11 +203,11 @@ Methods Same as arc, but also draws straight lines between the end points and the center of the bounding box. - :param xy: Two points to define the bounding box. Sequence of - ``[(x0, y0), (x1, y1)]`` or ``[x0, y0, x1, y1]``, - where ``x1 >= x0`` and ``y1 >= y0``. - :param start: Starting angle, in degrees. Angles are measured from - 3 o'clock, increasing clockwise. + :param xy: Two points to define the bounding box. Sequence of ``[(x0, y0), + (x1, y1)]`` or ``[x0, y0, x1, y1]``, where ``x1 >= x0`` and ``y1 >= + y0``. + :param start: Starting angle, in degrees. Angles are measured from 3 + o'clock, increasing clockwise. :param end: Ending angle, in degrees. :param fill: Color to use for the fill. :param outline: Color to use for the outline. diff --git a/docs/reference/ImageStat.rst b/docs/reference/ImageStat.rst index 28a884d05..d79006190 100644 --- a/docs/reference/ImageStat.rst +++ b/docs/reference/ImageStat.rst @@ -20,12 +20,13 @@ for a region of an image. Min/max values for each band in the image. - .. Note:: This relies on the :py:meth:`~PIL.Image.histogram` method, and simply - returns the low and high bins used. This is correct for images with 8 bits per - channel, but fails for other modes such as ``I`` or ``F``. Instead, use - :py:meth:`~PIL.Image.getextrema` to return per-band extrema for the image. - This is more correct and efficient because, for non-8-bit modes, the histogram - method uses :py:meth:`~PIL.Image.getextrema` to determine the bins used. + .. Note:: This relies on the :py:meth:`~PIL.Image.histogram` method, + and simply returns the low and high bins used. This is correct for + images with 8 bits per channel, but fails for other modes such as + ``I`` or ``F``. Instead, use :py:meth:`~PIL.Image.getextrema` to + return per-band extrema for the image. This is more correct and + efficient because, for non-8-bit modes, the histogram method uses + :py:meth:`~PIL.Image.getextrema` to determine the bins used. .. py:attribute:: count