comparison sat/plugins/plugin_comp_file_sharing.py @ 3329:15612c0fb421

plugin XEP-0264: updated size to get values closest to standard one: - sizes used for thumbnails are now matching common resolutions. - added BIG and FULL_SCREEN sizes - sort thumbnails by sizes when parsing them.
author Goffi <goffi@goffi.org>
date Thu, 13 Aug 2020 23:45:59 +0200
parents 5887fb414758
children b1e9f17fbb5a
comparison
equal deleted inserted replaced
3328:d49607e3a066 3329:15612c0fb421
432 if not mime_type or mime_type == "application/octet-stream": 432 if not mime_type or mime_type == "application/octet-stream":
433 mime_type = mimetypes.guess_type(name)[0] 433 mime_type = mimetypes.guess_type(name)[0]
434 434
435 if mime_type is not None and mime_type.startswith("image"): 435 if mime_type is not None and mime_type.startswith("image"):
436 thumbnails = extra.setdefault(C.KEY_THUMBNAILS, []) 436 thumbnails = extra.setdefault(C.KEY_THUMBNAILS, [])
437 for max_thumb_size in (self._t.SIZE_SMALL, self._t.SIZE_MEDIUM): 437 for max_thumb_size in self._t.SIZES:
438 try: 438 try:
439 thumb_size, thumb_id = await self._t.generateThumbnail( 439 thumb_size, thumb_id = await self._t.generateThumbnail(
440 final_path, 440 final_path,
441 max_thumb_size, 441 max_thumb_size,
442 #  we keep thumbnails for 6 months 442 #  we keep thumbnails for 6 months