From 2560c9d3f222c875e1eb23e8ec0fdb72c0171527 Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 14 Mar 2018 08:11:20 +0100 Subject: [PATCH] plugin XEP-0264: handle truncated files --- src/plugins/plugin_xep_0264.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/plugin_xep_0264.py b/src/plugins/plugin_xep_0264.py index 138891cd..17923717 100755 --- a/src/plugins/plugin_xep_0264.py +++ b/src/plugins/plugin_xep_0264.py @@ -36,6 +36,10 @@ try: except: raise exceptions.MissingModule(u"Missing module pillow, please download/install it from https://python-pillow.github.io") +# cf. https://stackoverflow.com/a/23575424 +from PIL import ImageFile +ImageFile.LOAD_TRUNCATED_IMAGES = True + try: from twisted.words.protocols.xmlstream import XMPPHandler except ImportError: