Commit 35a1c2a4 authored by Dan Pascu's avatar Dan Pascu

Make sure the image is valid before attempting to read it

parent c6fc81ad
...@@ -491,7 +491,7 @@ class IconDescriptor(object): ...@@ -491,7 +491,7 @@ class IconDescriptor(object):
class Thumbnail(object): class Thumbnail(object):
def __new__(cls, filename): def __new__(cls, filename):
image_reader = QImageReader(filename) image_reader = QImageReader(filename)
if image_reader.canRead(): if image_reader.canRead() and image_reader.size().isValid():
if image_reader.supportsAnimation() and image_reader.imageCount() > 1: if image_reader.supportsAnimation() and image_reader.imageCount() > 1:
image_format = str(image_reader.format()) image_format = str(image_reader.format())
image_data = str(image_reader.device().readAll()) image_data = str(image_reader.device().readAll())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment