mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-03 20:14:17 -04:00
Detect image format solely on content.
Otherwise reading fails if the file extension is wrong. Closes #512
This commit is contained in:
parent
6e2de1cd79
commit
57ec558396
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue