zlepper / itlt

It's the little things mod, a mod about the little things.
MIT License
12 stars 5 forks source link

Crash on Windows when using an icon.png with dimensions above 128px² #14

Closed kreezxil closed 3 years ago

kreezxil commented 4 years ago

I believe it exists will all of your versions.

if the icon for the pack is larger than a certain, size, i think 32x32, on Windows machine the pack that the mod is in will crash.

On Linux and Mac it does not crash.

PaintNinja commented 4 years ago

The maximum allowed icon size on Windows is 256x256. Above that will cause a crash as you've discovered. 64x64 should work fine.

PaintNinja commented 4 years ago

Turns out I was wrong. While Windows does support icons up-to 256x256, itlt's method of setting the icon on Windows permits a maximum of 128x128, still much larger than your suspected 32x32 though. :)

kreezxil commented 4 years ago

the other issue, don't forget is the Linux or at least KDE on Linux appears to have no limit such as this.

On Tue, Jul 21, 2020 at 12:27 PM Oscar Nardone notifications@github.com wrote:

Turns out I was wrong. While Windows does support icons up-to 256x256, itlt's method of setting the icon on Windows permits a maximum of 128x128, still much larger than your suspected 32x32 though. :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zlepper/itlt/issues/14#issuecomment-661998614, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5TJCAVGDNXXYZ3BZOTUNDR4XFYNANCNFSM4NOQAFMA .

PaintNinja commented 4 years ago

This limitation is on Windows' side, not ours.

Besides, I doubt you'll need more than 128x for a window icon - above that without a proper ico file will theoretically enforce bilinear or even nearest neighbour downscaling on most displays leading to a really blurry and ugly icon. You can see this for yourself if you set a 128x icon.png in itlt and look at the window icon on the top left.

Infact, using a 400x400 png on any platform will likely scale down poorly compared to an image with resolution of power of two (e.g. 32x, 64x, 128x) unless you're using like a 4k 13" display or something.

A possible solution in the future would be to support ico files, but I'll have to look into how to go about it as I'm not sure how hard it would be to implement while maintaining Linux and Mac compatibility.

kreezxil commented 4 years ago

the point is you've identified the issue, and hopefully like the other mods that now provide title bar icons, you've implemented code that handles oversized icon files. and a wiki entry that says "if icon == blurry, the icon not in the specified formats."

Good Job and thanks for your amazing work.

On Wed, Jul 22, 2020 at 7:09 AM Oscar Nardone notifications@github.com wrote:

This limitation is on Windows' side, not ours.

Besides, I doubt you'll need more than 128x for a window icon - above that without a proper ico file will theoretically enforce bilinear downscaling on most displays leading to a really blurry and ugly icon. You can see this for yourself if you set a 128x icon.png in itlt and look at the window icon on the top left.

Infact, using a 400x400 png on any platform will likely scale down poorly compared to an image with resolution of power of two (e.g. 32x, 64x, 128x) unless you're using like a 4k 13" display or something.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zlepper/itlt/issues/14#issuecomment-662416295, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5TJCGLOUSPULAVLQKIEG3R43JG3ANCNFSM4NOQAFMA .

PaintNinja commented 4 years ago

Added wiki with some details regarding this, will look into supporting ico files in the future, no guarantees though. https://github.com/zlepper/itlt/wiki

kreezxil commented 4 years ago

Fancy Menu btw, now supports icons, and it scales oversized images.

RandomPatches only support 16,32, & 256, however its config tells you that is what it supports.

it might be as simple as updating your config to say what the limit is.

On Fri, Jul 24, 2020 at 1:19 PM Oscar Nardone notifications@github.com wrote:

Added wiki with some details regarding this, will look into supporting ico files in the future, no guarantees though. https://github.com/zlepper/itlt/wiki

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zlepper/itlt/issues/14#issuecomment-663670045, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5TJCDB72ESQCZIZWE6BYLR5HGA7ANCNFSM4NOQAFMA .

PaintNinja commented 3 years ago

This has been fixed and all suggestions implemented in v2.

With v2, you can use an ICO with multiple images inside of different sizes, with no size restrictions. I've tested it with this icon that goes up to 256px and it works even on Windows. When an exact size it needs isn't available, it'll grab the closest one and resize it automatically. v2 supports ICO, ICNS and PNG on all operating systems, but currently, only ICO supports the huge sizes you're wanting.

The configs and wiki have been updated for v1 to reflect their requirements. v2's config is detailed and also has a dedicated wiki page for iconography if you really want a lot of depth: https://github.com/zlepper/itlt/wiki/Customising-your-modpack's-branding