From dc533e26c9682ae82e39327870b167c639e63081 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Sun, 13 Oct 2019 22:12:58 +0800 Subject: [PATCH] fix: always detect format from content --- README.md | 4 ++++ graphicsview.cpp | 1 + 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 15fc8ed..9593e66 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,7 @@ - For windows build, win32 APIs are used. - No license file provided. - No drag-window-border-to-resize support under non-windows platforms (I use Meta+Drag to resize window under my x11 desktop). + +## License + +This program released under MIT license diff --git a/graphicsview.cpp b/graphicsview.cpp index 09f6e14..6f08acf 100644 --- a/graphicsview.cpp +++ b/graphicsview.cpp @@ -42,6 +42,7 @@ void GraphicsView::showFromUrlList(const QList &urlList) showGif(filePath); } else { QImageReader imageReader(filePath); + imageReader.setDecideFormatFromContent(true); QImage::Format imageFormat = imageReader.imageFormat(); if (imageFormat == QImage::Format_Invalid) { showText(tr("File is not a valid image"));