comparison cagou/core/image.py @ 433:aa204c813f07

chat: attachment preview: - if there is not already one, a preview is generated for images collection thumbnails, instead of using the full size image. - for images attachment, local path is now used if present, before URL.
author Goffi <goffi@goffi.org>
date Sun, 01 Mar 2020 22:11:25 +0100
parents 1da3c379205b
children b5e8e470f7f7
comparison
equal deleted inserted replaced
432:36c3f1c02d33 433:aa204c813f07
45 try: 45 try:
46 self._coreimage = ci = CoreImage(filename, mipmap=mipmap, 46 self._coreimage = ci = CoreImage(filename, mipmap=mipmap,
47 anim_delay=self.anim_delay, 47 anim_delay=self.anim_delay,
48 keep_data=self.keep_data, 48 keep_data=self.keep_data,
49 nocache=self.nocache) 49 nocache=self.nocache)
50 except Exception as e: 50 except Exception:
51 # loading failed probably because of unmanaged extention, 51 # loading failed probably because of unmanaged extention,
52 # we try our luck with with PIL 52 # we try our luck with with PIL
53 try: 53 try:
54 im = PIL.Image.open(filename) 54 im = PIL.Image.open(filename)
55 ext = im.format.lower() 55 ext = im.format.lower()