From 434921f169734a244d450beae4c21cbd87905c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20Pag=C3=A8s=20Gassull?= Date: Sun, 26 Jan 2025 22:27:24 +0100 Subject: [PATCH 1/2] [online_image] Document JPEG support --- components/online_image.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/online_image.rst b/components/online_image.rst index 9fae6f349c..f5986ef875 100644 --- a/components/online_image.rst +++ b/components/online_image.rst @@ -13,10 +13,12 @@ With this component you can define images that will be downloaded, decoded and d Current supported formats: - - PNG - - BMP images, currently only binary uncompressed images are supported + - JPEG + + - PNG + .. warning:: This component requires a fair amount of RAM; both for downloading the image, and for storing the decoded image. It might work on devices without PSRAM, but there is no guarantee. @@ -38,8 +40,9 @@ Configuration variables in your display code. - **format** (**Required**): The format that the image is encoded with. - - ``PNG``: The image on the server is encoded in PNG format. - ``BMP``: The image on the server is encoded in BMP format. + - ``JPEG``: The image on the server is encoded in JPEG format. + - ``PNG``: The image on the server is encoded in PNG format. - **resize** (*Optional*, string): If set, this will resize the image to fit inside the given dimensions ``WIDTHxHEIGHT`` and preserve the aspect ratio. - **placeholder** (**Optional**, :ref:`config-id`): ID of an :doc:`Image ` to display while the downloaded image is not yet ready. @@ -54,6 +57,10 @@ Configuration variables - **transparency** (*Optional*): If set the alpha channel of the input image will be taken into account. The possible values are ``opaque`` (default), ``chroma_key`` and ``alpha_channel``. See the discussion on transparency in the :ref:`image component `. - **update_interval** (*Optional*, int): Redownload the image when the specified time has elapsed. Defaults to ``never`` (i.e. the update component action needs to be called manually). +Advanced options: + +- **buffer_size** (*Optional*, int): Explicitly specify the size of the buffer where the image chunks are being downloaded while decoding. The default value (65536) should be OK for most use cases, but you can try to reduce the size for slow connections, to avoid watchdog timeouts. + Automations ----------- From 917e22e3237454cf2c3888cf89a50cd34b8f1789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillem=20Pag=C3=A8s=20Gassull?= Date: Tue, 28 Jan 2025 22:31:45 +0100 Subject: [PATCH 2/2] Add note about progressive JPEGs --- components/online_image.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/online_image.rst b/components/online_image.rst index f5986ef875..6aa8d5601d 100644 --- a/components/online_image.rst +++ b/components/online_image.rst @@ -15,9 +15,9 @@ With this component you can define images that will be downloaded, decoded and d - BMP images, currently only binary uncompressed images are supported - - JPEG + - JPEG images, currently only baseline images (no progressive support) - - PNG + - PNG images .. warning::