tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
79.7k stars 2.37k forks source link

[bug] The build version of a app on windows seems to have lower res. #7069

Open eyyyyyyy3 opened 1 year ago

eyyyyyyy3 commented 1 year ago

Describe the bug

Like the title suggests I noticed that the build version of my app has a slightly different res.
Unbenannt The right icon is the "npm run tauri dev" version and the left one is the "npm run tauri build" version installed with nsis.

I am on Windows 11

Reproduction

No response

Expected behavior

Same icons,

Platform and versions

[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 113.0.1774.50
    ✔ MSVC:
        - Visual Studio Professional 2022
        - Visual Studio Build Tools 2019
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 18.16.0
    - npm: 9.6.7

[-] Packages
    - tauri [RUST]: 1.3.0
    - tauri-build [RUST]: 1.3.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.3.0
    - @tauri-apps/cli [NPM]: 1.3.1

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite

Stack trace

No response

Additional context

No response

FabianLars commented 1 year ago

Sooo, from my understanding this is entirely Windows' fault. To explain: In tauri dev, we "force" Windows to use the 32x32px icon as a source, it may scale it before displaying it but not sure if it does. After building the exe, the provided .ico file will be part of it and Windows will decide itself which icon layer (16x16px up to 256x256px) to use and how to scale it.

Again, not 100% sure about it, but that's how i understand it after researching .ico files&sizes for the tauri icon command.