mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Report detected image type in exception
This commit is contained in:
parent
166f16374b
commit
1de94d39e2
@ -82,9 +82,10 @@ def image_from_data(data):
|
|||||||
return data
|
return data
|
||||||
i = QImage()
|
i = QImage()
|
||||||
if not i.loadFromData(data):
|
if not i.loadFromData(data):
|
||||||
if what(None, data) == 'jxr':
|
q = what(None, data)
|
||||||
|
if q == 'jxr':
|
||||||
return load_jxr_data(data)
|
return load_jxr_data(data)
|
||||||
raise NotImage('Not a valid image')
|
raise NotImage('Not a valid image (detected type: {})'.format(q))
|
||||||
return i
|
return i
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user