mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Absence of libusb no longer causes a crash.
This commit is contained in:
parent
e49372ddf4
commit
61f84a63fc
@ -44,7 +44,7 @@ from libprs500.ebooks.lrf.html.table import Table
|
|||||||
from libprs500 import filename_to_utf8, setup_cli_handlers, __appname__
|
from libprs500 import filename_to_utf8, setup_cli_handlers, __appname__
|
||||||
from libprs500.ptempfile import PersistentTemporaryFile
|
from libprs500.ptempfile import PersistentTemporaryFile
|
||||||
from libprs500.ebooks.metadata.opf import OPFReader
|
from libprs500.ebooks.metadata.opf import OPFReader
|
||||||
|
from libprs500.devices.interface import Device
|
||||||
|
|
||||||
class HTMLConverter(object):
|
class HTMLConverter(object):
|
||||||
SELECTOR_PAT = re.compile(r"([A-Za-z0-9\-\_\:\.]+[A-Za-z0-9\-\_\:\.\s\,]*)\s*\{([^\}]*)\}")
|
SELECTOR_PAT = re.compile(r"([A-Za-z0-9\-\_\:\.]+[A-Za-z0-9\-\_\:\.\s\,]*)\s*\{([^\}]*)\}")
|
||||||
@ -1430,7 +1430,7 @@ def process_file(path, options, logger=None):
|
|||||||
cpath = os.path.abspath(os.path.expanduser(options.cover))
|
cpath = os.path.abspath(os.path.expanduser(options.cover))
|
||||||
options.cover = cpath
|
options.cover = cpath
|
||||||
if os.access(options.cover, os.R_OK):
|
if os.access(options.cover, os.R_OK):
|
||||||
from libprs500.devices.prs500.driver import PRS500
|
th = Device.THUMBNAIL_HEIGHT
|
||||||
im = PILImage.open(os.path.join(cwd, cpath))
|
im = PILImage.open(os.path.join(cwd, cpath))
|
||||||
cim = im.resize((options.profile.screen_width,
|
cim = im.resize((options.profile.screen_width,
|
||||||
options.profile.screen_height),
|
options.profile.screen_height),
|
||||||
@ -1439,7 +1439,7 @@ def process_file(path, options, logger=None):
|
|||||||
cf.close()
|
cf.close()
|
||||||
cim.save(cf.name)
|
cim.save(cf.name)
|
||||||
cpath = cf.name
|
cpath = cf.name
|
||||||
th = PRS500.THUMBNAIL_HEIGHT
|
|
||||||
tim = im.resize((int(0.75*th), th), PILImage.ANTIALIAS).convert('RGB')
|
tim = im.resize((int(0.75*th), th), PILImage.ANTIALIAS).convert('RGB')
|
||||||
tf = PersistentTemporaryFile(prefix="html2lrf_", suffix=".jpg")
|
tf = PersistentTemporaryFile(prefix="html2lrf_", suffix=".jpg")
|
||||||
tf.close()
|
tf.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user