# HG changeset patch
# User Goffi <goffi@goffi.org>
# Date 1521011480 -3600
# Node ID 327bbbe793cebf57b0ce71d617011002d1b47743
# Parent  25e16729413bf98bf7e63d6257543e570125fd96
plugin XEP-0264: handle truncated files

diff -r 25e16729413b -r 327bbbe793ce src/plugins/plugin_xep_0264.py
--- 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: