comparison src/plugins/plugin_xep_0264.py @ 2521:327bbbe793ce

plugin XEP-0264: handle truncated files
author Goffi <goffi@goffi.org>
date Wed, 14 Mar 2018 08:11:20 +0100
parents 2d3c9dcec384
children 65e278997715
comparison
equal deleted inserted replaced
2520:25e16729413b 2521:327bbbe793ce
33 import hashlib 33 import hashlib
34 try: 34 try:
35 from PIL import Image 35 from PIL import Image
36 except: 36 except:
37 raise exceptions.MissingModule(u"Missing module pillow, please download/install it from https://python-pillow.github.io") 37 raise exceptions.MissingModule(u"Missing module pillow, please download/install it from https://python-pillow.github.io")
38
39 # cf. https://stackoverflow.com/a/23575424
40 from PIL import ImageFile
41 ImageFile.LOAD_TRUNCATED_IMAGES = True
38 42
39 try: 43 try:
40 from twisted.words.protocols.xmlstream import XMPPHandler 44 from twisted.words.protocols.xmlstream import XMPPHandler
41 except ImportError: 45 except ImportError:
42 from wokkel.subprotocols import XMPPHandler 46 from wokkel.subprotocols import XMPPHandler