Validate "encoding" attribute of "image/png" file nodes.
This commit is contained in:
@@ -747,6 +747,8 @@ namespace glabels
|
||||
QString encoding = XmlUtil::getStringAttr( node, "encoding", "base64" );
|
||||
|
||||
if ( mimetype == "image/png" )
|
||||
{
|
||||
if ( encoding == "base64" )
|
||||
{
|
||||
QByteArray ba64 = node.text().toUtf8();
|
||||
QByteArray ba = QByteArray::fromBase64( ba64 );
|
||||
@@ -755,6 +757,11 @@ namespace glabels
|
||||
|
||||
data.addImage( name, image );
|
||||
}
|
||||
else
|
||||
{
|
||||
qWarning() << "Unexpected encoding:" << encoding << "node:" << node.tagName();
|
||||
}
|
||||
}
|
||||
else if ( mimetype == "image/svg+xml" )
|
||||
{
|
||||
data.addSvg( name, node.text().toUtf8() );
|
||||
|
||||
Reference in New Issue
Block a user