tc-hib / go-winres

Command line tool for adding Windows resources to executable files
BSD Zero Clause License
319 stars 16 forks source link

Large icon view not using 256px png #3

Closed optix2000 closed 3 years ago

optix2000 commented 3 years ago

Hi,

Love this project and how easy it makes embedding Windows resources.

I might be hitting some really obscure Windows bug, but for some reason my 256px icon embedded with go-winres is not being displayed at full resolution (ie. when using (Extra) Large icons in Explorer).

You can see the comparisons with go-winres here in Explorer using Extra Large icons:

Capture

My winres/ folder here: https://github.com/optix2000/totsugeki/tree/v0.2.0/winres Running Windows 10.0.19043.1110

I've even tried adding all the "required" sizes (16px, 32px, 48px, 256px) to no avail. https://github.com/optix2000/totsugeki/tree/16xicon/winres

Is there some limitation or option that needs to be set for the 256px icon to be used at full resolution?

tc-hib commented 3 years ago

Hello,

Thanks for filing this bug report.

There seem to be a bug because of the original size not being 256x256 but 256x215. To fix your icon, you can resize the picture to 256x256. Then, I suggest you write "0000": "icon.png" instead of "0000": [ "icon.png" ] for better quality: image

I'll try to find some time today to fix the bug. Thanks again.

tc-hib commented 3 years ago

Alright, Explorer only supports square icons with the required sizes from your link. (thanks a lot for that) Even 64x64 and 128x128 aren't displayed properly.

So I've fixed winres as it was registering 256x215 instead of 256x256 in the ICO file, but you can still force a size that Explorer doesn't like, and I should probably talk about that in the Readme.

Thanks a lot.

optix2000 commented 3 years ago

Thanks for responding so quickly!

There seem to be a bug because of the original size not being 256x256 but 256x215. To fix your icon, you can resize the picture to 256x256.

I forgot to mention, but in my test branch https://github.com/optix2000/totsugeki/tree/16xicon/winres I squared all the images and that didn't fix it either. I'll try the latest version and give it a shot.

Then, I suggest you write "0000": "icon.png" instead of "0000": [ "icon.png" ] for better quality:

I'm curious, what changes when you do this?

tc-hib commented 3 years ago

I forgot to mention, but in my test branch https://github.com/optix2000/totsugeki/tree/16xicon/winres I squared all the images and that didn't fix it either. I'll try the latest version and give it a shot.

I think you didn't see the difference because of the icon cache. Try to rename the exe file with a new name you haven't already used.

I'm curious, what changes when you do this?

As a single string it's one file: an ICO or a PNG. If it's a PNG file instead of an ICO, winres generates the sizes for you (16, 32, 48, 64, 256).