PICARD-2919: fix download of GIF images (and maybe others)

Issue is the data downloaded is QtCore.QBytesArray object, and it wasn't convert to bytes.
So ensure it is converted before passing it to image detection methods.
This commit is contained in:
Laurent Monin
2024-06-01 16:01:49 +02:00
committed by Philipp Wolfer
parent b29a8f692c
commit 0653bd3305

View File

@@ -572,12 +572,13 @@ class WebService(QtCore.QObject):
log.debug("Response received: %s", document)
except Exception as e:
log.error("Unable to parse the response for %s -> %s", display_reply_url, e)
document = reply.readAll()
document = bytes(reply.readAll())
error = e
finally:
handler(document, reply, error)
else:
handler(reply.readAll(), reply, error)
# readAll() returns QtCore.QByteArray, so convert to bytes
handler(bytes(reply.readAll()), reply, error)
ratecontrol.adjust(hostkey, slow_down)