etternagame / etterna

Advanced cross-platform rhythm game focused on keyboard play
https://etternaonline.com/
MIT License
474 stars 132 forks source link

[Bug]: Pack banners with uppercase file extensions are not loaded #1303

Closed niet-dev closed 2 months ago

niet-dev commented 2 months ago

Is there an existing issue for this?

Contact Details

Reply to the issue, or Discord: nietscape

Version Info

Latest available release

What operating system are you seeing the problem on?

Windows

Bug Behavior

If a pack banner has an uppercase file extension, the banner is not loaded. This is uncommon, but true for some packs that are downloaded in-game.

Expected Behavior

The banner should be displayed as if it had a lowercase file extension.

Reproduction Steps

  1. Open the game
  2. Download a pack like NBJS2 or midare megapack 5
  3. Notice the pack banner does not appear
  4. Go to the pack directory, change the file extension to lowercase (bn.PNG > bn.png, bn.JPG > bn.jpg)
  5. Restart etterna, pack banner appears

Anything else?

This is only true of pack banners. Chart banners with uppercase file extensions are loaded just fine (see Blockbuster, Comsten from NBJS2).

poco0317 commented 2 months ago

a really fast way to try to fix it is by modifying this https://github.com/etternagame/etterna/blob/9a0b9fb94ea0c1f4d24b707bd00fad24d94d22ec/src/RageUtil/Utils/RageUtil.cpp#L1000-L1012

but it is also possible that filesystems care too much about case sensitivity for that to work. we can instead change the logic here to make it more general

https://github.com/etternagame/etterna/blob/9a0b9fb94ea0c1f4d24b707bd00fad24d94d22ec/src/Etterna/Actor/Base/ActorUtil.cpp#L499-L586

poco0317 commented 2 months ago

7bc8e6e30963845b2fd736b5cb1666df84be592a