Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[online_image] Document JPEG support #4617

Merged
merged 4 commits into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions components/online_image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 images, currently only baseline images (no progressive support)

- PNG images

.. 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.
Expand All @@ -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 </components/image>` to display while the downloaded image is not yet ready.
Expand All @@ -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 <display-image>`.
- **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
-----------

Expand Down