summaryrefslogtreecommitdiffstats
path: root/pictureviewer2.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2024-08-24 23:24:50 +0200
committerArno <arno@disconnect.de>2024-08-31 11:56:45 +0200
commit66606fd5cc6bd3d377cc35d9ce2e267b694410fc (patch)
treec84c66431c49954251031e401f9ff852290e7345 /pictureviewer2.cpp
parent7f10707eb9c9ab9d4651022bfa89550b05d375c2 (diff)
downloadSheMov-66606fd5cc6bd3d377cc35d9ce2e267b694410fc.tar.gz
SheMov-66606fd5cc6bd3d377cc35d9ce2e267b694410fc.tar.bz2
SheMov-66606fd5cc6bd3d377cc35d9ce2e267b694410fc.zip
Catch Magick::Exception
Prevent crash when trying to convert a file to png. This was a hard one. After checking into detached QT-Containers I finally realized that convertArchivefileToPng was the culprit, because ImageMagick::read exited with an "Unsupported marker type 0x09" execption. After some more investigation with convert, or magick convert these days, I found out that they could be ignored. Yes, it's a big hammer, but if it still fails after trying to convert, just return if still don't have a valid image.
Diffstat (limited to 'pictureviewer2.cpp')
-rw-r--r--pictureviewer2.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/pictureviewer2.cpp b/pictureviewer2.cpp
index e56f52a..1e49bdf 100644
--- a/pictureviewer2.cpp
+++ b/pictureviewer2.cpp
@@ -449,6 +449,10 @@ void PictureViewer2::showFile(const PicData &file){
if(pixmap.isNull()){
if(fi.canonicalFilePath().startsWith(mArchiveDir)){
mCurPicData = Helper::convertArchivefileToPng(file);
+ if(mCurPicData.isEmpty()){
+ //convert failed even though ignoring errors
+ return;
+ }
mFiles[mCurPos] = mCurPicData;
if(!mCurPicData.isEmpty()){
pixmap = QPixmap(mCurPicData.at(3).toString());