Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
143a7c2b by wurstsalat at 2025-07-08T21:37:01+02:00
fix: Preview: Guard for errors while trying to create thumbnails
Fixes #12360
- - - - -
1 changed file:
- gajim/common/preview.py
Changes:
=====================================
gajim/common/preview.py
=====================================
@@ -351,13 +351,19 @@ def create_preview(self,
preview)
def create_thumbnail(self, preview: Preview, data: bytes) -> None:
- future = app.process_pool.submit(
- create_thumbnail,
- data,
- preview.size,
- preview.mime_type,
- )
- future.add_done_callback(partial(self._write_thumbnail, preview))
+ try:
+ future = app.process_pool.submit(
+ create_thumbnail,
+ data,
+ preview.size,
+ preview.mime_type,
+ )
+ future.add_done_callback(partial(self._write_thumbnail, preview))
+ except Exception as error:
+ preview.info_message = _('Creating thumbnail failed')
+ preview.update_widget()
+ log.warning('Creating thumbnail failed for: %s %s',
+ preview.orig_path, error)
def _write_thumbnail(self, preview: Preview, future: Future[bytes | None])
-> None:
try:
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/143a7c2be7ae9037cc18986a645c3cf03b3a9049
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/143a7c2be7ae9037cc18986a645c3cf03b3a9049
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]