mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Pre-import calibre.utils.img when building manual as otherwise importing it can fail
This commit is contained in:
parent
49e45e052e
commit
b966579e88
@ -20,9 +20,10 @@ sys.path.append(base)
|
||||
sys.path.insert(0, os.path.dirname(base))
|
||||
from setup import __appname__, __version__
|
||||
from calibre.utils.localization import localize_website_link
|
||||
import calibre.utils.img as cimg
|
||||
import custom
|
||||
del sys.path[0]
|
||||
custom
|
||||
custom, cimg
|
||||
# General configuration
|
||||
# ---------------------
|
||||
|
||||
|
@ -25,7 +25,6 @@ from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||
from calibre.ebooks.chardet import xml_to_unicode
|
||||
from calibre.utils.config import OptionParser
|
||||
from calibre.utils.filenames import ascii_filename
|
||||
from calibre.utils.img import image_from_data, image_to_data
|
||||
from calibre.utils.imghdr import what
|
||||
from calibre.utils.logging import Log
|
||||
from calibre.web.fetch.utils import rescale_image
|
||||
@ -440,6 +439,7 @@ class RecursiveFetcher:
|
||||
x.write(data)
|
||||
tag['src'] = imgpath
|
||||
else:
|
||||
from calibre.utils.img import image_from_data, image_to_data
|
||||
try:
|
||||
# Ensure image is valid
|
||||
img = image_from_data(data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user