mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Windows 64bit build: Fix corrupted images in MOBI files causing crash. Fixes #1264534 [calibre-parallel has stopped working](https://bugs.launchpad.net/calibre/+bug/1264534)
Loads the PIL C extensions from the file system as they apparently use exceptions that cause crash with MemoryModule
This commit is contained in:
parent
25f8ba4abd
commit
78911d6077
@ -671,7 +671,10 @@ class Win32Freeze(Command, WixMixIn):
|
|||||||
sp = self.j(self.lib_dir, 'site-packages')
|
sp = self.j(self.lib_dir, 'site-packages')
|
||||||
# Special handling for PIL and pywin32
|
# Special handling for PIL and pywin32
|
||||||
handled = set(['PIL.pth', 'pywin32.pth', 'PIL', 'win32'])
|
handled = set(['PIL.pth', 'pywin32.pth', 'PIL', 'win32'])
|
||||||
if not is64bit:
|
if is64bit:
|
||||||
|
# PIL can raise exceptions, which cause crashes on 64bit
|
||||||
|
shutil.copytree(self.j(sp, 'PIL'), self.j(self.dll_dir, 'PIL'))
|
||||||
|
else:
|
||||||
self.add_to_zipfile(zf, 'PIL', sp)
|
self.add_to_zipfile(zf, 'PIL', sp)
|
||||||
base = self.j(sp, 'win32', 'lib')
|
base = self.j(sp, 'win32', 'lib')
|
||||||
for x in os.listdir(base):
|
for x in os.listdir(base):
|
||||||
|
@ -414,6 +414,13 @@ Build and install with::
|
|||||||
Note that the lcms module will not be built. PIL requires lcms-1.x but only
|
Note that the lcms module will not be built. PIL requires lcms-1.x but only
|
||||||
lcms-2.x can be compiled as a 64 bit library.
|
lcms-2.x can be compiled as a 64 bit library.
|
||||||
|
|
||||||
|
Pillow >= 2.2 installs itself as a .egg file. calibre needs it to be a PIL
|
||||||
|
directory. Extract the PIL directory as follows:
|
||||||
|
cd /cygdrive/c/Python27/Lib/site-packages
|
||||||
|
mkdir p && cd p
|
||||||
|
unzip ../Pillow-*.egg
|
||||||
|
cd .. && rm Pillow-*.egg && mv p/PIL . && chmod +x PIL/*.pyd
|
||||||
|
|
||||||
Test it on the target system with
|
Test it on the target system with
|
||||||
|
|
||||||
calibre-debug -c "from PIL import Image; import _imaging, _imagingmath, _imagingft"
|
calibre-debug -c "from PIL import Image; import _imaging, _imagingmath, _imagingft"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user