Compare commits

...

10 Commits
main ... 4.1.x

Author SHA1 Message Date
Hugo
bfda6b4b39 Merge pull request #2581 from gdtrice/patch-2
Fixing small typo
2017-06-21 09:09:13 +03:00
Garland Trice
959e9d9657 Fixing small typo
Working on a small project, reading thru the docs and noticed this.
2017-06-20 21:44:06 -07:00
wiredfool
2b4486a588 Update CHANGES.rst release date [ci skip] 2017-04-28 16:42:26 +01:00
wiredfool
c0e92ca5f5 4.1.1 Version Bump 2017-04-20 04:48:24 -07:00
wiredfool
e3190960b5 Updated CHANGES.rst [ci skip] 2017-04-20 04:38:03 -07:00
wiredfool
3f82790e54 4.1.1 release notes 2017-04-20 04:30:50 -07:00
wiredfool
ed72440381 Undef PySlice_GetIndicesEx, see https://bugs.python.org/issue29943 2017-04-20 03:53:04 -07:00
Hugo
926a778d40 Fix for file with DPI in EXIF but not metadata, and XResolution is an int rather than tuple 2017-04-20 03:51:47 -07:00
Hugo
e7f156c909 Remove broken downloads badge
Let's remove the downloads badge as it's broken and showing 0 downloads/month.

See also https://github.com/python-pillow/Pillow/issues/2396 and https://github.com/badges/shields/issues/716.

[CI skip]
2017-04-19 03:10:47 -07:00
Bjorn
686b6bd282 Add missing colon in :command:... 2017-04-19 03:10:36 -07:00
16 changed files with 72 additions and 14 deletions

View File

@ -1,6 +1,22 @@
Changelog (Pillow) Changelog (Pillow)
================== ==================
4.1.1 (2017-04-28)
------------------
- Undef PySlice_GetIndicesEx, see https://bugs.python.org/issue29943 #2493
[cgohlke]
- Fix for file with DPI in EXIF but not metadata, and XResolution is an int rather than tuple #2484
[hugovk]
- Docs: Removed broken download counter badge #2487
[hugovk]
- Docs: Fixed rst syntax error #2477
[thebjorn]
4.1.0 (2017-04-03) 4.1.0 (2017-04-03)
------------------ ------------------

View File

@ -123,7 +123,10 @@ def APP(self, marker):
try: try:
resolution_unit = exif[0x0128] resolution_unit = exif[0x0128]
x_resolution = exif[0x011A] x_resolution = exif[0x011A]
dpi = x_resolution[0] / x_resolution[1] try:
dpi = x_resolution[0] / x_resolution[1]
except TypeError:
dpi = x_resolution
if resolution_unit == 3: # cm if resolution_unit == 3: # cm
# 1 dpcm = 2.54 dpi # 1 dpcm = 2.54 dpi
dpi *= 2.54 dpi *= 2.54

View File

@ -12,7 +12,7 @@
# ;-) # ;-)
VERSION = '1.1.7' # PIL version VERSION = '1.1.7' # PIL version
PILLOW_VERSION = '4.1.0' # Pillow PILLOW_VERSION = '4.1.1' # Pillow
__version__ = PILLOW_VERSION __version__ = PILLOW_VERSION

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@ -501,14 +501,24 @@ class TestFileJpeg(PillowTestCase):
reloaded.load() reloaded.load()
self.assertEqual(im.info['dpi'], reloaded.info['dpi']) self.assertEqual(im.info['dpi'], reloaded.info['dpi'])
def test_dpi_from_exif(self): def test_dpi_tuple_from_exif(self):
# Arrange # Arrange
# This Photoshop CC 2017 image has DPI in EXIF not metadata # This Photoshop CC 2017 image has DPI in EXIF not metadata
# EXIF XResolution is (2000000, 10000)
im = Image.open("Tests/images/photoshop-200dpi.jpg") im = Image.open("Tests/images/photoshop-200dpi.jpg")
# Act / Assert # Act / Assert
self.assertEqual(im.info.get("dpi"), (200, 200)) self.assertEqual(im.info.get("dpi"), (200, 200))
def test_dpi_int_from_exif(self):
# Arrange
# This image has DPI in EXIF not metadata
# EXIF XResolution is 72
im = Image.open("Tests/images/exif-72dpi-int.jpg")
# Act / Assert
self.assertEqual(im.info.get("dpi"), (72, 72))
def test_dpi_from_dpcm_exif(self): def test_dpi_from_dpcm_exif(self):
# Arrange # Arrange
# This is photoshop-200dpi.jpg with EXIF resolution unit set to cm: # This is photoshop-200dpi.jpg with EXIF resolution unit set to cm:
@ -535,7 +545,7 @@ class TestFileCloseW32(PillowTestCase):
def setUp(self): def setUp(self):
if "jpeg_encoder" not in codecs or "jpeg_decoder" not in codecs: if "jpeg_encoder" not in codecs or "jpeg_decoder" not in codecs:
self.skipTest("jpeg support not available") self.skipTest("jpeg support not available")
def test_fd_leak(self): def test_fd_leak(self):
tmpfile = self.tempfile("temp.jpg") tmpfile = self.tempfile("temp.jpg")
import os import os
@ -549,8 +559,9 @@ class TestFileCloseW32(PillowTestCase):
self.assertRaises(Exception, lambda: os.remove(tmpfile)) self.assertRaises(Exception, lambda: os.remove(tmpfile))
im.load() im.load()
self.assertTrue(fp.closed) self.assertTrue(fp.closed)
# this should not fail, as load should have closed the file. # this should not fail, as load should have closed the file.
os.remove(tmpfile) os.remove(tmpfile)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

View File

@ -71,7 +71,7 @@
* See the README file for information on usage and redistribution. * See the README file for information on usage and redistribution.
*/ */
#define PILLOW_VERSION "4.1.0" #define PILLOW_VERSION "4.1.1"
#include "Python.h" #include "Python.h"

View File

@ -1,5 +1,6 @@
#define PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN
#include <Python.h> #include <Python.h>
#include "Imaging.h"
#include "py3.h" #include "py3.h"
#include <webp/encode.h> #include <webp/encode.h>
#include <webp/decode.h> #include <webp/decode.h>

View File

@ -1,4 +1,4 @@
version: 4.1.0.{build} version: 4.1.1.{build}
clone_folder: c:\pillow clone_folder: c:\pillow
init: init:
- ECHO %PYTHON% - ECHO %PYTHON%

View File

@ -26,10 +26,6 @@ Pillow is the friendly PIL fork by `Alex Clark and Contributors <https://github.
:target: https://pypi.python.org/pypi/Pillow/ :target: https://pypi.python.org/pypi/Pillow/
:alt: Latest PyPI version :alt: Latest PyPI version
.. image:: https://img.shields.io/pypi/dm/pillow.svg
:target: https://pypi.python.org/pypi/Pillow/
:alt: Number of PyPI downloads
.. image:: https://coveralls.io/repos/python-pillow/Pillow/badge.svg?branch=master .. image:: https://coveralls.io/repos/python-pillow/Pillow/badge.svg?branch=master
:target: https://coveralls.io/github/python-pillow/Pillow?branch=master :target: https://coveralls.io/github/python-pillow/Pillow?branch=master
:alt: Code coverage :alt: Code coverage

View File

@ -64,7 +64,7 @@ Fonts
PIL can use bitmap fonts or OpenType/TrueType fonts. PIL can use bitmap fonts or OpenType/TrueType fonts.
Bitmap fonts are stored in PILs own format, where each font typically consists Bitmap fonts are stored in PILs own format, where each font typically consists
of a two files, one named .pil and the other usually named .pbm. The former of two files, one named .pil and the other usually named .pbm. The former
contains font metrics, the latter raster data. contains font metrics, the latter raster data.
To load a bitmap font, use the load functions in the :py:mod:`~PIL.ImageFont` To load a bitmap font, use the load functions in the :py:mod:`~PIL.ImageFont`

View File

@ -9,7 +9,7 @@ this class store bitmap fonts, and are used with the
:py:meth:`PIL.ImageDraw.Draw.text` method. :py:meth:`PIL.ImageDraw.Draw.text` method.
PIL uses its own font file format to store bitmap fonts. You can use the PIL uses its own font file format to store bitmap fonts. You can use the
:command`pilfont` utility to convert BDF and PCF font descriptors (X window :command:`pilfont` utility to convert BDF and PCF font descriptors (X window
font formats) to this format. font formats) to this format.
Starting with version 1.1.4, PIL can be configured to support TrueType and Starting with version 1.1.4, PIL can be configured to support TrueType and

View File

@ -0,0 +1,24 @@
4.1.1
-----
Fix Regression with reading DPI from EXIF data
==============================================
Some JPEG images don't contain DPI information in the image metadata,
but do contain it in the EXIF data. A patch was added in 4.1.0 to read
from the EXIF data, but it did not accept all possible types that
could be included there. This fix adds the ability to read ints as
well as rational values.
Incompatibility between 3.6.0 and 3.6.1
=======================================
CPython 3.6.1 added a new symbol, PySlice_GetIndicesEx, which was not
present in 3.6.0. This had the effect of causing binaries compiled on
CPython 3.6.1 to not work on installations of C-Python 3.6.0. This fix
undefines PySlice_GetIndicesEx if it exists to restore compatibility
with both 3.6.0 and 3.6.1. See https://bugs.python.org/issue29943 for
more details.

View File

@ -6,6 +6,7 @@ Release Notes
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
4.1.1
4.1.0 4.1.0
4.0.0 4.0.0
3.4.0 3.4.0

View File

@ -9,6 +9,11 @@
#include "Python.h" #include "Python.h"
/* Workaround issue #2479 */
#if PY_VERSION_HEX < 0x03070000 && defined(PySlice_GetIndicesEx) && !defined(PYPY_VERSION)
#undef PySlice_GetIndicesEx
#endif
/* Check that we have an ANSI compliant compiler */ /* Check that we have an ANSI compliant compiler */
#ifndef HAVE_PROTOTYPES #ifndef HAVE_PROTOTYPES
#error Sorry, this library requires support for ANSI prototypes. #error Sorry, this library requires support for ANSI prototypes.

1
path.c
View File

@ -27,6 +27,7 @@
#include "Python.h" #include "Python.h"
#include "Imaging.h"
#include <math.h> #include <math.h>

View File

@ -102,7 +102,7 @@ except (ImportError, OSError):
_tkinter = None _tkinter = None
NAME = 'Pillow' NAME = 'Pillow'
PILLOW_VERSION = '4.1.0' PILLOW_VERSION = '4.1.1'
JPEG_ROOT = None JPEG_ROOT = None
JPEG2K_ROOT = None JPEG2K_ROOT = None
ZLIB_ROOT = None ZLIB_ROOT = None