Repository navigation
fix(codegen): select largest ICO entry instead of first - #15241
Conversation
Package Changes Through 08f17d6There are 14 changes which include tauri-cli with minor, @tauri-apps/cli with minor, tauri with minor, tauri-build with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, @tauri-apps/api with minor, tauri-bundler with minor, tauri-macos-sign with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-driver with minor Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
|
Thanks for contributing! Using the biggest image in the It seems like the way this was somewhat tackled way back in a80d5b7 by putting the 32x32 one to be the first entry 😂 Perhaps we could make it select the biggest entry under say 32x32 or 64x64 (64 × 64 × 4 = 16,384 bytes) for now, this should be a sufficient sized icon for the taskbar icons on most devices, and ideally we could add support of using the embedded resource icons as mentioned in #14596 (comment) |
|
we should also look into using tao's https://docs.rs/tao/latest/x86_64-pc-windows-msvc/tao/platform/windows/trait.WindowExtWindows.html#tymethod.set_taskbar_icon for large icons since you mentioned alt-tab which will use this one. |
|
Ok so Instead of using a decoded RGBA buffer, |
…s#15462) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
aa984be to
50c2cef
Compare
Legend-Master
left a comment
There was a problem hiding this comment.
Thanks! I will merge this one after #15274 so we don't embed huge images
…the post-tauri-apps#15274 scope Compare width*height (with bits_per_pixel as tie-breaker) instead of width alone, and panic with the icon path instead of a bare unwrap when the ICO has no entries. Since tauri-apps#15274 the Windows default window icon is read from the exe resource, so this only affects .ico files embedded via include_image! or as the tray icon; update the change file accordingly.
Closes #14596
new_ico()intauri-codegenusesentries()[0]to select which image from an ICO file to embed as the window icon. Since ICO files conventionally store entries smallest-first, this picks the 16x16 image. When the OS needs a larger size (taskbar, alt-tab), it scales up from 16x16, resulting in a blurry icon.This selects the largest entry instead, giving the OS a high-resolution source to downscale from.
crates/tauri-codegen/src/image.rsrustfmt --checkandcargo check -p tauri-codegen