mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:...
This commit is contained in:
parent
8944c7e984
commit
a05d1b3614
@ -267,6 +267,15 @@ _check_symlinks_prescript()
|
|||||||
dst = os.path.join(resource_dir, 'lib', 'python2.5', 'IPython')
|
dst = os.path.join(resource_dir, 'lib', 'python2.5', 'IPython')
|
||||||
if os.path.exists(dst): shutil.rmtree(dst)
|
if os.path.exists(dst): shutil.rmtree(dst)
|
||||||
shutil.copytree(os.path.expanduser('~/build/ipython/IPython'), dst)
|
shutil.copytree(os.path.expanduser('~/build/ipython/IPython'), dst)
|
||||||
|
|
||||||
|
print
|
||||||
|
print 'Adding ImageMagick'
|
||||||
|
dest = os.path.join(frameworks_dir, 'ImageMagick')
|
||||||
|
if os.path.exists(dest):
|
||||||
|
sutil.rmtree(dest)
|
||||||
|
shutil.copytree(os.path.expanduser('~/ImageMagick'), dest, True)
|
||||||
|
shutil.copyfile('/usr/local/lib/libpng12.0.dylib', os.path.join(dest, 'lib', 'libpng12.0.dylib'))
|
||||||
|
|
||||||
print
|
print
|
||||||
print 'Installing prescipt'
|
print 'Installing prescipt'
|
||||||
sf = [os.path.basename(s) for s in all_names]
|
sf = [os.path.basename(s) for s in all_names]
|
||||||
|
@ -16,7 +16,8 @@ from calibre.ptempfile import PersistentTemporaryDirectory
|
|||||||
from calibre.utils.threadpool import ThreadPool, WorkRequest
|
from calibre.utils.threadpool import ThreadPool, WorkRequest
|
||||||
from calibre.utils.terminfo import ProgressBar
|
from calibre.utils.terminfo import ProgressBar
|
||||||
from calibre.ebooks.lrf.pylrs.pylrs import Book, BookSetting, ImageStream, ImageBlock
|
from calibre.ebooks.lrf.pylrs.pylrs import Book, BookSetting, ImageStream, ImageBlock
|
||||||
from calibre.utils.PythonMagickWand import \
|
try:
|
||||||
|
from calibre.utils.PythonMagickWand import \
|
||||||
NewMagickWand, NewPixelWand, \
|
NewMagickWand, NewPixelWand, \
|
||||||
MagickSetImageBorderColor, \
|
MagickSetImageBorderColor, \
|
||||||
MagickReadImage, MagickRotateImage, \
|
MagickReadImage, MagickRotateImage, \
|
||||||
@ -30,6 +31,9 @@ from calibre.utils.PythonMagickWand import \
|
|||||||
MagickWriteImage, DestroyPixelWand, \
|
MagickWriteImage, DestroyPixelWand, \
|
||||||
DestroyMagickWand, CloneMagickWand, \
|
DestroyMagickWand, CloneMagickWand, \
|
||||||
MagickThumbnailImage, MagickCropImage, initialize, finalize
|
MagickThumbnailImage, MagickCropImage, initialize, finalize
|
||||||
|
_imagemagick_loaded = True
|
||||||
|
except:
|
||||||
|
_imagemagick_loaded = False
|
||||||
|
|
||||||
PROFILES = {
|
PROFILES = {
|
||||||
'prs500':(584, 754),
|
'prs500':(584, 754),
|
||||||
@ -198,6 +202,8 @@ def process_pages(pages, opts, update):
|
|||||||
'''
|
'''
|
||||||
Render all identified comic pages.
|
Render all identified comic pages.
|
||||||
'''
|
'''
|
||||||
|
if not _imagemagick_loaded:
|
||||||
|
raise RuntimeError('Failed to load ImageMagick')
|
||||||
initialize()
|
initialize()
|
||||||
try:
|
try:
|
||||||
tdir = PersistentTemporaryDirectory('_comic2lrf_pp')
|
tdir = PersistentTemporaryDirectory('_comic2lrf_pp')
|
||||||
|
2
src/calibre/utils/PythonMagickWand.py
Executable file → Normal file
2
src/calibre/utils/PythonMagickWand.py
Executable file → Normal file
@ -73,7 +73,7 @@ isosx = 'darwin' in sys.platform
|
|||||||
isfrozen = getattr(sys, 'frozen', False)
|
isfrozen = getattr(sys, 'frozen', False)
|
||||||
|
|
||||||
if isosx:
|
if isosx:
|
||||||
_lib = os.path.join(getattr(sys, 'frameworks_dir'), 'ImageMagick', 'libWand.dylib') \
|
_lib = os.path.join(getattr(sys, 'frameworks_dir'), 'ImageMagick', 'libMagickWand.dylib') \
|
||||||
if isfrozen else util.find_library('Wand')
|
if isfrozen else util.find_library('Wand')
|
||||||
elif iswindows:
|
elif iswindows:
|
||||||
_lib = os.path.join(os.path.dirname(sys.executable), 'ImageMagick', 'CORE_RL_wand_.dll') \
|
_lib = os.path.join(os.path.dirname(sys.executable), 'ImageMagick', 'CORE_RL_wand_.dll') \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user