Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.