Use qDecodeDataUrl to parse image from data url
The old code scanned for the "base64," token from the end
(lastIndexOf()), even though the token appears near the beginning of a
data: URL and cannot repeat. This means we scan potentially large
amounts of (base-64-encoded) image data without purpose.
Instead of using indexOf(), port to QtCore's qDecodeDataUrl(), which
also takes non-base64-encoded data into account. The disadvantage is
that this now requires several recodings (QString -> QUrl -> QString ->
QByteArray). Created QTBUG-134665 to ask for a faster implementation.
Pick-to: 6.9 6.8 6.5
Task-number: QTBUG-134665
Change-Id: I59e7039be44cd2e0a1a97d78db203a330196d13f
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>