0 byte image file error
Versions
- OS: Arch Linux
- GTK Version: 3.24.29
- PyGObject Version: 3.40.1
- GLib Version : 2.68.0
- python-nbxmpp Version: 2.0.2
- Gajim Version: 1.3.2
Traceback
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/gajim/common/helpers.py", line 1347, in _on_load_finished
callback(contents, None, user_data)
File "/home/nico/.local/share/gajim/plugins/url_image_preview/url_image_preview.py", line 380, in _on_orig_load_finished
if preview.create_thumbnail(data):
File "/home/nico/.local/share/gajim/plugins/url_image_preview/url_image_preview.py", line 816, in create_thumbnail
self.thumbnail = create_thumbnail(data, self.size)
File "/home/nico/.local/share/gajim/plugins/url_image_preview/utils.py", line 132, in create_thumbnail
return create_thumbnail_with_pixbuf(data, size)
File "/home/nico/.local/share/gajim/plugins/url_image_preview/utils.py", line 143, in create_thumbnail_with_pixbuf
loader.close()
gi.repository.GLib.GError: gdk-pixbuf-error-quark: Unrecognized image file format (3)
Steps to reproduce the problem
Due to some weird coincidence a received a 0 byte http upload file, gajim tries to open the file every time I open that particular chat window of course and stumbles over this error.
I think the best way to fix this would be discard the thumbnail generation on very obvious occasions like
- 0 byte files
- files missing various image magic bytes