This commit is contained in:
Kovid Goyal 2008-07-30 15:49:26 -07:00
parent 8944c7e984
commit a05d1b3614
3 changed files with 30 additions and 15 deletions

View File

@ -267,6 +267,15 @@ _check_symlinks_prescript()
dst = os.path.join(resource_dir, 'lib', 'python2.5', 'IPython')
if os.path.exists(dst): shutil.rmtree(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 'Installing prescipt'
sf = [os.path.basename(s) for s in all_names]

View File

@ -16,7 +16,8 @@ from calibre.ptempfile import PersistentTemporaryDirectory
from calibre.utils.threadpool import ThreadPool, WorkRequest
from calibre.utils.terminfo import ProgressBar
from calibre.ebooks.lrf.pylrs.pylrs import Book, BookSetting, ImageStream, ImageBlock
from calibre.utils.PythonMagickWand import \
try:
from calibre.utils.PythonMagickWand import \
NewMagickWand, NewPixelWand, \
MagickSetImageBorderColor, \
MagickReadImage, MagickRotateImage, \
@ -30,6 +31,9 @@ from calibre.utils.PythonMagickWand import \
MagickWriteImage, DestroyPixelWand, \
DestroyMagickWand, CloneMagickWand, \
MagickThumbnailImage, MagickCropImage, initialize, finalize
_imagemagick_loaded = True
except:
_imagemagick_loaded = False
PROFILES = {
'prs500':(584, 754),
@ -198,6 +202,8 @@ def process_pages(pages, opts, update):
'''
Render all identified comic pages.
'''
if not _imagemagick_loaded:
raise RuntimeError('Failed to load ImageMagick')
initialize()
try:
tdir = PersistentTemporaryDirectory('_comic2lrf_pp')

2
src/calibre/utils/PythonMagickWand.py Executable file → Normal file
View File

@ -73,7 +73,7 @@ isosx = 'darwin' in sys.platform
isfrozen = getattr(sys, 'frozen', False)
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')
elif iswindows:
_lib = os.path.join(os.path.dirname(sys.executable), 'ImageMagick', 'CORE_RL_wand_.dll') \