Materials: Add support for embedded images
Adds support for file types other than PNG to embedded images in materials. Adds checks to prevent crashing when an unsupported image type is used.
This commit is contained in:
committed by
Chris Hennes
parent
556fc32c30
commit
902012f12f
@@ -134,7 +134,7 @@ ImageEdit::ImageEdit(const QString& propertyName,
|
||||
QString value = _property->getString();
|
||||
if (!value.isEmpty()) {
|
||||
QByteArray by = QByteArray::fromBase64(value.toUtf8());
|
||||
QImage img = QImage::fromData(by, "PNG");
|
||||
QImage img = QImage::fromData(by);
|
||||
_pixmap = QPixmap::fromImage(img);
|
||||
}
|
||||
showPixmap();
|
||||
|
||||
Reference in New Issue
Block a user