Merge branch 'master' into yapf-formatting

Conflicts:
	PIL/Image.py
This commit is contained in:
Alex Clark 2015-04-02 14:47:10 -04:00
commit 6d0a4a0149
5 changed files with 15 additions and 8 deletions

View File

@ -1,6 +1,12 @@
Changelog (Pillow)
==================
2.8.1 (2015-04-02)
------------------
- Bug fix: Catch struct.error on invalid JPEG, fixes #1163
[wiredfool, hugovk]
2.8.0 (2015-04-01)
------------------

View File

@ -104,6 +104,7 @@ from PIL._util import deferred_error
import os
import sys
import io
import struct
# type stuff
import collections
@ -589,7 +590,7 @@ class Image:
def _repr_png_(self):
""" iPython display hook support
:returns: png version of the image as bytes
"""
from io import BytesIO
@ -882,8 +883,8 @@ class Image:
elif isinstance(t, int):
self.im.putpalettealpha(t, 0)
else:
raise ValueError(
"Transparency for P mode should" + " be bytes or int")
raise ValueError("Transparency for P mode should" +
" be bytes or int")
if mode == "P" and palette == ADAPTIVE:
im = self.im.quantize(colors)
@ -2243,7 +2244,7 @@ def open(fp, mode="r"):
im = factory(fp, filename)
_decompression_bomb_check(im.size)
return im
except (SyntaxError, IndexError, TypeError):
except (SyntaxError, IndexError, TypeError, struct.error):
# import traceback
# traceback.print_exc()
pass
@ -2258,7 +2259,7 @@ def open(fp, mode="r"):
im = factory(fp, filename)
_decompression_bomb_check(im.size)
return im
except (SyntaxError, IndexError, TypeError):
except (SyntaxError, IndexError, TypeError, struct.error):
# import traceback
# traceback.print_exc()
pass

View File

@ -12,7 +12,7 @@
# ;-)
VERSION = '1.1.7' # PIL version
PILLOW_VERSION = '2.8.0' # Pillow
PILLOW_VERSION = '2.8.1' # Pillow
_plugins = ['BmpImagePlugin', 'BufrStubImagePlugin', 'CurImagePlugin',
'DcxImagePlugin', 'EpsImagePlugin', 'FitsStubImagePlugin',

View File

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

View File

@ -90,7 +90,7 @@ except (ImportError, OSError):
NAME = 'Pillow'
PILLOW_VERSION = '2.8.0'
PILLOW_VERSION = '2.8.1'
TCL_ROOT = None
JPEG_ROOT = None
JPEG2K_ROOT = None