Detect image format solely on content.

Otherwise reading fails if the file extension is wrong.

Closes #512
This commit is contained in:
Felix Geyer 2016-07-31 15:36:29 +02:00
parent 6e2de1cd79
commit 57ec558396

View File

@ -131,6 +131,8 @@ void EditWidgetIcons::addCustomIcon()
this, tr("Select Image"), "", filter);
if (!filename.isEmpty()) {
QImageReader imageReader(filename);
// detect from content, otherwise reading fails if file extension is wrong
imageReader.setDecideFormatFromContent(true);
QImage image = imageReader.read();
if (!image.isNull()) {
Uuid uuid = Uuid::random();