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

Key image size bug fixes #377

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Giraut
Copy link

@Giraut Giraut commented Mar 7, 2024

  • 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 7, 2024 11:27
… 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
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.

1 participant