Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfda6b4b39 | ||
|
|
959e9d9657 | ||
|
|
2b4486a588 | ||
|
|
c0e92ca5f5 | ||
|
|
e3190960b5 | ||
|
|
3f82790e54 | ||
|
|
ed72440381 | ||
|
|
926a778d40 | ||
|
|
e7f156c909 | ||
|
|
686b6bd282 |
16
CHANGES.rst
16
CHANGES.rst
@ -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)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
BIN
Tests/images/exif-72dpi-int.jpg
Normal file
BIN
Tests/images/exif-72dpi-int.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
@ -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()
|
||||||
|
|||||||
@ -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"
|
||||||
|
|
||||||
|
|||||||
1
_webp.c
1
_webp.c
@ -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>
|
||||||
|
|||||||
@ -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%
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -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 PIL’s own format, where each font typically consists
|
Bitmap fonts are stored in PIL’s 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`
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
24
docs/releasenotes/4.1.1.rst
Normal file
24
docs/releasenotes/4.1.1.rst
Normal 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.
|
||||||
|
|
||||||
|
|
||||||
@ -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
|
||||||
|
|||||||
@ -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
1
path.c
@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
#include "Imaging.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user