Validate "encoding" attribute of "image/png" file nodes.
This commit is contained in:
@@ -748,12 +748,19 @@ namespace glabels
|
|||||||
|
|
||||||
if ( mimetype == "image/png" )
|
if ( mimetype == "image/png" )
|
||||||
{
|
{
|
||||||
QByteArray ba64 = node.text().toUtf8();
|
if ( encoding == "base64" )
|
||||||
QByteArray ba = QByteArray::fromBase64( ba64 );
|
{
|
||||||
QImage image;
|
QByteArray ba64 = node.text().toUtf8();
|
||||||
image.loadFromData( ba, "PNG" );
|
QByteArray ba = QByteArray::fromBase64( ba64 );
|
||||||
|
QImage image;
|
||||||
|
image.loadFromData( ba, "PNG" );
|
||||||
|
|
||||||
data.addImage( name, image );
|
data.addImage( name, image );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qWarning() << "Unexpected encoding:" << encoding << "node:" << node.tagName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( mimetype == "image/svg+xml" )
|
else if ( mimetype == "image/svg+xml" )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user