mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
News download: Fix a bug that could cause a crash when downloading an SVG image. Fixes #1669530 [Fetching News for "New York Times" produces error](https://bugs.launchpad.net/calibre/+bug/1669530)
See https://bugreports.qt.io/browse/QTBUG-59266
This commit is contained in:
parent
faf46f844f
commit
0041d18a2c
@ -397,7 +397,7 @@ class RecursiveFetcher(object):
|
||||
if isinstance(fname, unicode):
|
||||
fname = fname.encode('ascii', 'replace')
|
||||
itype = what(None, data)
|
||||
if itype is None and b'<svg' in data[:1024]:
|
||||
if itype == 'svg' or (itype is None and b'<svg' in data[:1024]):
|
||||
# SVG image
|
||||
imgpath = os.path.join(diskpath, fname+'.svg')
|
||||
with self.imagemap_lock:
|
||||
|
Loading…
x
Reference in New Issue
Block a user