changeset 2521:327bbbe793ce

plugin XEP-0264: handle truncated files
author Goffi <goffi@goffi.org>
date Wed, 14 Mar 2018 08:11:20 +0100 (2018-03-14)
parents 25e16729413b
children 95c31756944c
files src/plugins/plugin_xep_0264.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0264.py	Wed Mar 14 08:10:31 2018 +0100
+++ b/src/plugins/plugin_xep_0264.py	Wed Mar 14 08:11:20 2018 +0100
@@ -36,6 +36,10 @@
 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: