diff --git a/TODO.md b/TODO.md index 16eea2d7..132e4169 100644 --- a/TODO.md +++ b/TODO.md @@ -3,8 +3,6 @@ - Accent color from background - Reduce messages ListView cacheBuffer height once http thumbnails downloading is implemented -- Button can get "hoverEnabled: false" to let HoverHandlers work -- Handle thumbnail response status 400 - Improve avatar tooltips position, add stuff to room tooltips (last msg?) - Accept drag and dropping a picture in account settings to set avatar - When all the events loaded on beginning in a room are name/avatar changes, @@ -18,6 +16,7 @@ - Refactoring - Don't bake in size properties for components - Unfinished work in button-refactor branch + - Button can get "hoverEnabled: false" to let HoverHandlers work - Room Sidepane - Bug fixes diff --git a/src/python/image_provider.py b/src/python/image_provider.py index 5e1afb51..b15fb099 100644 --- a/src/python/image_provider.py +++ b/src/python/image_provider.py @@ -92,6 +92,13 @@ class Thumbnail: height = self.server_size[1], method = self.resize_method, ) + + if isinstance(response, nio.ThumbnailError): + # Return a transparent 1x1 PNG + with BytesIO() as img_out: + PILImage.new("RGBA", (1, 1), (0, 0, 0, 0)).save(img_out, "PNG") + return img_out.getvalue() + body = response.body if response.content_type not in ("image/jpeg", "image/png"):