From 157a2a3a69c40eadf09f7d1629e36326ed24ba1d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 Mar 2014 12:53:33 +0530 Subject: [PATCH] Prevent ImageMagick crash in identify when debugging MOBI6 files --- src/calibre/ebooks/mobi/debug/mobi6.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/mobi/debug/mobi6.py b/src/calibre/ebooks/mobi/debug/mobi6.py index cfe1f34eca..1ba59b2537 100644 --- a/src/calibre/ebooks/mobi/debug/mobi6.py +++ b/src/calibre/ebooks/mobi/debug/mobi6.py @@ -17,7 +17,7 @@ from calibre.ebooks.mobi.reader.index import (parse_index_record, parse_tagx_section) from calibre.ebooks.mobi.utils import (decode_hex_number, decint, decode_tbs, read_font_record) -from calibre.utils.magick.draw import identify_data +from calibre.utils.imghdr import what from calibre.ebooks.mobi.debug import format_bytes from calibre.ebooks.mobi.debug.headers import TextRecord @@ -763,7 +763,7 @@ class MOBIFile(object): # {{{ b'\xe9\x8e\r\n', b'RESC', b'BOUN', b'FDST', b'DATP', b'AUDI', b'VIDE', b'FONT'}: try: - width, height, fmt = identify_data(r.raw) + fmt = what(None, r.raw) except: pass if fmt is not None: