From 57d53a8a3bdfcf7f984caa5de4877857bcd4e6d4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 May 2016 14:07:22 +0530 Subject: [PATCH] Dont use ImageMagick when building the manual --- manual/epub.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manual/epub.py b/manual/epub.py index cda286bb0c..3692f349c7 100644 --- a/manual/epub.py +++ b/manual/epub.py @@ -14,7 +14,7 @@ from calibre.ebooks.oeb.base import OPF, DC from calibre.ebooks.oeb.polish.container import get_container, OEB_DOCS from calibre.ebooks.oeb.polish.check.links import check_links, UnreferencedResource from calibre.ebooks.oeb.polish.pretty import pretty_html_tree, pretty_opf -from calibre.utils.magick.draw import identify_data +from calibre.utils.imghdr import identify class EPUBHelpBuilder(EpubBuilder): name = 'myepub' @@ -40,7 +40,9 @@ class EPUBHelpBuilder(EpubBuilder): for img in root.xpath('//*[local-name() = "img" and (@class = "float-right-img" or @class = "float-left-img")]'): if 'style' not in img.attrib: imgname = container.href_to_name(img.get('src'), name) - width, height, fmt = identify_data(container.raw_data(imgname)) + fmt, width, height = identify(container.raw_data(imgname)) + if width == -1: + raise ValueError('Failed to read size of: %s' % imgname) img.set('style', 'width: %dpx; height: %dpx' % (width, height)) def fix_opf(self, container):