Skip to content

Decode cached images by content and wrap tooltip text - #22

Merged
itz4blitz merged 1 commit into
itz4blitz:mainfrom
vbmithr:fix/cached-image-decoding
Oct 17, 2026
Merged

itz4blitz merged 1 commit into
itz4blitz:mainfrom
vbmithr:fix/cached-image-decoding

Conversation

@vbmithr

@vbmithr vbmithr commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Downloaded Discord images failed to display on Linux/Windows because media cache filenames are extensionless hashes, while the still-image decoder selected the format from the filename. The error tooltip also let its text extend beyond its background.

Detect image formats from their bytes, as the avatar decoder already does, and prevent thumbnail decoding from enlarging a smaller source. Give tooltip text a shrinking, wrapping flex slot within the 240px box while keeping shortcut labels on one line. Update the system and media design specifications.

Validation:

  • The extensionless cache regression failed before the fix and passes for PNG, JPEG, and WebP afterwards.
  • The existing thumbnail sizing/cropping regression now passes; previously it enlarged a 64×32 BMP to 4096×2048 against its documented contract.
  • Full GUI-feature tests pass on the PR base.
  • Arch package revision 18 built successfully; the user confirmed the previously reported image now loads.
  • git diff --check passes. Tooltip wrapping was not visually verified after the change.

Detect still-image formats from bytes because media cache filenames have
no extensions. Keep small sources at their native size. Constrain
tooltip text to its flex slot so failure reasons wrap within the
background.

Cover extensionless PNG, JPEG, and WebP files and update the design
docs. All 309 GUI tests pass, with one ignored.

Co-Authored-By: GPT-6 <noreply@openai.com>
@vbmithr
vbmithr requested a review from itz4blitz as a code owner October 17, 2026 16:30

@itz4blitz itz4blitz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache files have no extension, and ImageReader::with_guessed_format reads the bytes the way the macOS path already does. The thumbnail edge is now capped at the source's long side, so a small picture is no longer scaled up to the requested size. The tooltip text sits in a shrinking flex slot inside the 240-point box, and the shortcut stays on one line. macOS, Linux, and Windows are green on 2d1d7e1.

@itz4blitz
itz4blitz merged commit 00bcc32 into itz4blitz:main Oct 17, 2026
3 checks passed
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.

2 participants