mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-15 11:56:28 +03:00
commit
43883a9928
|
@ -1,6 +1,15 @@
|
||||||
Changelog (Pillow)
|
Changelog (Pillow)
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
2.5.1 (2014-07-09)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
- Fixed install issue if Multiprocessing.Pool is not available
|
||||||
|
[wiredfool]
|
||||||
|
|
||||||
|
- 32bit mult overflow fix #782
|
||||||
|
[wiredfool]
|
||||||
|
|
||||||
2.5.0 (2014-07-01)
|
2.5.0 (2014-07-01)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# ;-)
|
# ;-)
|
||||||
|
|
||||||
VERSION = '1.1.7' # PIL version
|
VERSION = '1.1.7' # PIL version
|
||||||
PILLOW_VERSION = '2.5.0' # Pillow
|
PILLOW_VERSION = '2.5.1' # Pillow
|
||||||
|
|
||||||
_plugins = ['BmpImagePlugin',
|
_plugins = ['BmpImagePlugin',
|
||||||
'BufrStubImagePlugin',
|
'BufrStubImagePlugin',
|
||||||
|
|
|
@ -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.5.0"
|
#define PILLOW_VERSION "2.5.1"
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
|
||||||
|
|
|
@ -69,4 +69,6 @@
|
||||||
#define FLOAT32 float
|
#define FLOAT32 float
|
||||||
#define FLOAT64 double
|
#define FLOAT64 double
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
typedef signed __int64 int64_t;
|
||||||
|
#endif
|
||||||
|
|
|
@ -379,7 +379,7 @@ ImagingNew(const char* mode, int xsize, int ysize)
|
||||||
} else
|
} else
|
||||||
bytes = strlen(mode); /* close enough */
|
bytes = strlen(mode); /* close enough */
|
||||||
|
|
||||||
if ((Py_ssize_t) xsize * ysize * bytes <= THRESHOLD) {
|
if ((int64_t) xsize * (int64_t) ysize * bytes <= THRESHOLD) {
|
||||||
im = ImagingNewBlock(mode, xsize, ysize);
|
im = ImagingNewBlock(mode, xsize, ysize);
|
||||||
if (im)
|
if (im)
|
||||||
return im;
|
return im;
|
||||||
|
|
|
@ -5,6 +5,11 @@ from multiprocessing import Pool, cpu_count
|
||||||
from distutils.ccompiler import CCompiler
|
from distutils.ccompiler import CCompiler
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
try:
|
||||||
|
MAX_PROCS = int(os.environ.get('MAX_CONCURRENCY', cpu_count()))
|
||||||
|
except:
|
||||||
|
MAX_PROCS = None
|
||||||
|
|
||||||
|
|
||||||
# hideous monkeypatching. but. but. but.
|
# hideous monkeypatching. but. but. but.
|
||||||
def _mp_compile_one(tp):
|
def _mp_compile_one(tp):
|
||||||
|
@ -31,22 +36,27 @@ def _mp_compile(self, sources, output_dir=None, macros=None,
|
||||||
output_dir, macros, include_dirs, sources, depends, extra_postargs)
|
output_dir, macros, include_dirs, sources, depends, extra_postargs)
|
||||||
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
|
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
|
||||||
|
|
||||||
try:
|
pool = Pool(MAX_PROCS)
|
||||||
max_procs = int(os.environ.get('MAX_CONCURRENCY', cpu_count()))
|
|
||||||
except:
|
|
||||||
max_procs = None
|
|
||||||
pool = Pool(max_procs)
|
|
||||||
try:
|
try:
|
||||||
print ("Building using %d processes" % pool._processes)
|
print ("Building using %d processes" % pool._processes)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
arr = [
|
arr = [(self, obj, build, cc_args, extra_postargs, pp_opts)
|
||||||
(self, obj, build, cc_args, extra_postargs, pp_opts) for obj in objects
|
for obj in objects]
|
||||||
]
|
|
||||||
pool.map_async(_mp_compile_one, arr)
|
pool.map_async(_mp_compile_one, arr)
|
||||||
pool.close()
|
pool.close()
|
||||||
pool.join()
|
pool.join()
|
||||||
# Return *all* object filenames, not just the ones we just built.
|
# Return *all* object filenames, not just the ones we just built.
|
||||||
return objects
|
return objects
|
||||||
|
|
||||||
CCompiler.compile = _mp_compile
|
# explicitly don't enable if environment says 1 processor
|
||||||
|
if MAX_PROCS != 1:
|
||||||
|
try:
|
||||||
|
# bug, only enable if we can make a Pool. see issue #790 and
|
||||||
|
# http://stackoverflow.com/questions/6033599/oserror-38-errno-38-with-multiprocessing
|
||||||
|
pool = Pool(2)
|
||||||
|
CCompiler.compile = _mp_compile
|
||||||
|
except Exception as msg:
|
||||||
|
print("Exception installing mp_compile, proceeding without: %s" %msg)
|
||||||
|
else:
|
||||||
|
print("Single threaded build, not installing mp_compile: %s processes" %MAX_PROCS)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user