mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix image data URI
Make JPEG images use the image/jpeg mimetype instead of the wrong image/png one.
This commit is contained in:
parent
64f4d84e74
commit
bb4b8f0bc5
@ -274,7 +274,9 @@ bool ImageUtil::optimizeSizeHtml(QString &html, const QImage& original, QImage &
|
|||||||
if(optimizeSizeBytes(bytearray, original, optimized,has_transparency?"PNG":"JPG",maxPixels, maxBytes))
|
if(optimizeSizeBytes(bytearray, original, optimized,has_transparency?"PNG":"JPG",maxPixels, maxBytes))
|
||||||
{
|
{
|
||||||
QByteArray encodedByteArray = bytearray.toBase64();
|
QByteArray encodedByteArray = bytearray.toBase64();
|
||||||
html = "<img src=\"data:image/png;base64,";
|
html = "<img src=\"data:image/";
|
||||||
|
html.append(has_transparency ? "png" : "jpeg");
|
||||||
|
html.append(";base64,");
|
||||||
html.append(encodedByteArray);
|
html.append(encodedByteArray);
|
||||||
html.append("\">");
|
html.append("\">");
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user