Author Topic: ver. 16 crashes when loading sprites from ShoeBox...  (Read 343 times)

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Hi, unfortunatelly during final release tests of my project I encoutered serious bug in Steam version v16.
Trying to load sprite larger than 128px from shoebox will fail with fatal error like this:
Code: (glbasic) [Select]
Error: 3. Not a JPEG file: starts with 0x02 0x00This wasted me couple of hours figuring what's wrong with my game, as that info is outputted in stderr stream so wont appear in editor, and I forgot to include stderr in *bat file for outputting stdout..
Problem appears in v16 (Steam version), I checked and v15 ofc is working properly.
Simple project to show the issue. Baisically put larger sprite like 1024x1024px in shoebox then:
Code: (glbasic) [Select]
SETSHOEBOX "Media.sbx", ""
LOADSPRITE "sprite.png", 0
Will crash app... Hope that this will be an easy fix ;-)

« Last Edit: 2020-Apr-28 by dreamerman »
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
Android? or Windows?

none 24png files might crash for some reasons, which is why im allways uses full png with alpha with png files.

Its works here on Windows, if you uncomment SETCURRENTDIR("Media")

On Android, you cannot load png and jpg on android 5 and lower.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Windows 7.. same code, GLB v16 - Steam crashes, older standalone v15 works without problems.. 32bit PNG images.. will check on Win 10 laptop later, and with other png depths..
That's it if You uncomment SETCURRENTDIR than LoadSprites first goes to Media dir and load sprites from that location, not from ShoeBox, loading normal files is ofc ok, but loading from Shoebox fails.

Edit: reuploaded with 32bit png's and it crashes as mentioned above on my machine, only happens with Steam version, don't have previous v16 backups before updates so can't tell if it;s something new or what.
« Last Edit: 2020-Apr-28 by dreamerman »
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
doh, im was testing without using shoebox. testing later. your files was not in the showbox
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
File is in the shoebox, as I said, same code, same shoebox file: compiled with GLB v16 doesn't work, but compiled with v15 work without problems. Host OS not important, same results on win7 and win10.
Maybe some compression code for unpacking shoebox files was changed or something.. other thing is that shoebox tool from v16 makes a little different file than v15, image packing is same, differences only aplies to *wav files, difference in size in negligible (literally few bytes per file or something).
To get that error just compile with v16, and run that bat file that's in 'shoebox_bug.app' directory. Don't know if that's some internal GLB error or image processing library dependend.
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
im confirm. Can you check if its happens with other formats as well (jpg and bmp). Im do confirm the issue.
« Last Edit: 2020-Apr-28 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
As this problem is still an issue..
Anyone tried to implement zip/7z or some other compression libraries? Mostly to protect graphic assets, so they can't be easy copied, or maybe some other encoding functions?

Check my source code editor for GLBasic - link Update: 20.04.2020