comparison sat/plugins/plugin_comp_file_sharing_management.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 04a7d77ed86f
children be6d91572633
comparison
equal deleted inserted replaced
3328:d49607e3a066 3329:15612c0fb421
402 media_type = file_data['media_type'] 402 media_type = file_data['media_type']
403 file_path = os.path.join(self.files_path, file_data['file_hash']) 403 file_path = os.path.join(self.files_path, file_data['file_hash'])
404 if media_type == 'image': 404 if media_type == 'image':
405 thumbnails = [] 405 thumbnails = []
406 406
407 for max_thumb_size in (self._t.SIZE_SMALL, self._t.SIZE_MEDIUM): 407 for max_thumb_size in self._t.SIZES:
408 try: 408 try:
409 thumb_size, thumb_id = yield self._t.generateThumbnail( 409 thumb_size, thumb_id = yield self._t.generateThumbnail(
410 file_path, 410 file_path,
411 max_thumb_size, 411 max_thumb_size,
412 #  we keep thumbnails for 6 months 412 #  we keep thumbnails for 6 months