Key image size bug fixes by Giraut · Pull Request #188 · streamdeck-linux-gui/streamdeck-linux-gui · GitHub
Skip to content

Key image size bug fixes#188

Merged
coolapso merged 2 commits into
streamdeck-linux-gui:mainfrom
Giraut:key_image_size_bug_fixes
Apr 13, 2024
Merged

Key image size bug fixes#188
coolapso merged 2 commits into
streamdeck-linux-gui:mainfrom
Giraut:key_image_size_bug_fixes

Conversation

@Giraut

@Giraut Giraut commented Mar 8, 2024

Copy link
Copy Markdown
  • The change to streamdeck_ui/display/image_filter.py scales images up as well as down. PIL's Image.thumbnail method can never return an image larger than the original image, which makes images smaller than the key size such as desktop icons - e.g. with a lower resolution like 32x32 or 48x48 - not fill up the entire key image space. Image.resize lets any icon fill up the key.

  • The change to streamdeck_ui/display/display_grid.py is more subtle:

    If you have more than one Stream Deck connected and they have different key image sizes - for example a Stream Deck XL with 96x96 keys and a Stream Deck Plus with 120x120 keys - two DisplayGrid instances are created. The first one initialize the static class-level EmptyFilter instance upon creation and sets its image size once. Then the second one is created and sets the same EmptyFilter's image size a second time. Meaning all key images changed subsequently will have the key size of the last Stream Deck initialized.

    So in this example, if the Stream Deck Plus is the last one initialized, any key image changed on the Stream Deck XL will be 120x120, then scaled down to 96x96 upon display, appearing too small.

    The issue is fixed by having one EmptyFilter instance per DisplayGrid instance, each with the correct key size for the corresponding Stream Deck.

Giraut added 2 commits March 8, 2024 10:00
… instead of a single EmptyFilter for all the DisplayGrid instances, so the key images are displayed with the correct size on all the Stream Decks if more than one Stream Deck is connected and the Stream Decks have different image sizes for the keys
@coolapso coolapso merged commit 29fb45f into streamdeck-linux-gui:main Apr 13, 2024
coolapso pushed a commit that referenced this pull request Apr 13, 2024
* Correctly scale images up as well as down, in case they're smaller than the target key display size

* Initialize one separate EmptyFilter instance per DisplayGrid instance instead of a single EmptyFilter for all the DisplayGrid instances, so the key images are displayed with the correct size on all the Stream Decks if more than one Stream Deck is connected and the Stream Decks have different image sizes for the keys

---------

Co-authored-by: Giraut <>
@MrMEEE

MrMEEE commented Jun 22, 2024

Copy link
Copy Markdown

galastiaos pushed a commit to galastiaos/powerstreamdeck-linux-gui that referenced this pull request Nov 25, 2025
* Correctly scale images up as well as down, in case they're smaller than the target key display size

* Initialize one separate EmptyFilter instance per DisplayGrid instance instead of a single EmptyFilter for all the DisplayGrid instances, so the key images are displayed with the correct size on all the Stream Decks if more than one Stream Deck is connected and the Stream Decks have different image sizes for the keys

---------

Co-authored-by: Giraut <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants