mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-09 06:44:45 +03:00
Merge branch 'master' into yapf-formatting
Conflicts: PIL/Image.py
This commit is contained in:
commit
6d0a4a0149
|
@ -1,6 +1,12 @@
|
||||||
Changelog (Pillow)
|
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)
|
2.8.0 (2015-04-01)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ from PIL._util import deferred_error
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import io
|
import io
|
||||||
|
import struct
|
||||||
|
|
||||||
# type stuff
|
# type stuff
|
||||||
import collections
|
import collections
|
||||||
|
@ -882,8 +883,8 @@ class Image:
|
||||||
elif isinstance(t, int):
|
elif isinstance(t, int):
|
||||||
self.im.putpalettealpha(t, 0)
|
self.im.putpalettealpha(t, 0)
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError("Transparency for P mode should" +
|
||||||
"Transparency for P mode should" + " be bytes or int")
|
" be bytes or int")
|
||||||
|
|
||||||
if mode == "P" and palette == ADAPTIVE:
|
if mode == "P" and palette == ADAPTIVE:
|
||||||
im = self.im.quantize(colors)
|
im = self.im.quantize(colors)
|
||||||
|
@ -2243,7 +2244,7 @@ def open(fp, mode="r"):
|
||||||
im = factory(fp, filename)
|
im = factory(fp, filename)
|
||||||
_decompression_bomb_check(im.size)
|
_decompression_bomb_check(im.size)
|
||||||
return im
|
return im
|
||||||
except (SyntaxError, IndexError, TypeError):
|
except (SyntaxError, IndexError, TypeError, struct.error):
|
||||||
# import traceback
|
# import traceback
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
pass
|
pass
|
||||||
|
@ -2258,7 +2259,7 @@ def open(fp, mode="r"):
|
||||||
im = factory(fp, filename)
|
im = factory(fp, filename)
|
||||||
_decompression_bomb_check(im.size)
|
_decompression_bomb_check(im.size)
|
||||||
return im
|
return im
|
||||||
except (SyntaxError, IndexError, TypeError):
|
except (SyntaxError, IndexError, TypeError, struct.error):
|
||||||
# import traceback
|
# import traceback
|
||||||
# traceback.print_exc()
|
# traceback.print_exc()
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# ;-)
|
# ;-)
|
||||||
|
|
||||||
VERSION = '1.1.7' # PIL version
|
VERSION = '1.1.7' # PIL version
|
||||||
PILLOW_VERSION = '2.8.0' # Pillow
|
PILLOW_VERSION = '2.8.1' # Pillow
|
||||||
|
|
||||||
_plugins = ['BmpImagePlugin', 'BufrStubImagePlugin', 'CurImagePlugin',
|
_plugins = ['BmpImagePlugin', 'BufrStubImagePlugin', 'CurImagePlugin',
|
||||||
'DcxImagePlugin', 'EpsImagePlugin', 'FitsStubImagePlugin',
|
'DcxImagePlugin', 'EpsImagePlugin', 'FitsStubImagePlugin',
|
||||||
|
|
|
@ -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 "2.8.0"
|
#define PILLOW_VERSION "2.8.1"
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user