GLBasic Version 16.793 (Steam) does not load the jpg file and some png (confirm)

Previous topic - Next topic

Qedo

GLBasic Version 16.793 (Steam) does not load the jpg file and some png (probably large dimensions).
Verified on two computers (Win10).
Gernot could you verify?
Thank you

ad maiora

Kitty Hello


Qedo

Thank you.
Code (glbasic) Select
// --------------------------------- //
// Project: loadspritejpg
// Start: Wednesday, June 30, 2021
// IDE Version: 16.793
SETCURRENTDIR("Media") // go to media files
SETFONT 0,2
file$="any_jpeg_file_and_some_png.jpg"
IF DOESFILEEXIST(file$)
ok% = LOADSPRITEMEM(file$, w%, h%, pixRGBA%[])
LOADSPRITE file$,0
GETSPRITESIZE 0,sx,sy // return sx=0 and sy=0
DRAWSPRITE 0,0,0 // don't show the sprite
PRINT sx+" "+sy,0,0 // wrong dimensions=0
SHOWSCREEN
MOUSEWAIT
ELSE
PRINT "the file "+file$+" don't exist",0,0
SHOWSCREEN
MOUSEWAIT
ENDIF

Kitty Hello

Good find. It was a signed/unsigned error checking the first bytes of the file. I'll prepare an update.

Qedo

Gernot,
waiting for the update I am using version 16.720 and I have noticed that it crashes when I load (LOADSPRITE) large png files.
In my case the file is 3701x2387 pixels. With 15.238 version no problem
I do not know if this problem will be present in the future version but in any case I report it for your verification.
Thank you

Qedo

Update:
I did further tests and it is not the size of the images that cause the program to crash because I loaded even bigger png without problem.
Only the attached image (designed by me )  crash the program . I don't understand why with normal graphics programs (GIMP) I display it correctly.
You can check?
Thank you

spacefractal

There was a jpg issue in Greedy Mouse as well as a jpg indeeded did crash as well in one of the newer update, but here its was just a very small floor image that caused the crash. im ended here to just convert the to png and then its worked again, its was no big deal for me.

So im will confirm the issue as there is some jpg issues here. A issue im do cant fix here, up to Gernot.

Anyway im got you possible to revert to the lastet 2020 version on steam until then or convert them to png. Size is no biggie today at all.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Qedo

spacefractal thank you
In my case the problem is on the png file (which I have attached) and not on an ipg, and then the program I am writing must allow in real time to be able to load either jpg or png indifferently and therefore I cannot previously do any type of conversion.

Ad maiora

Qedo

Sorry maybe I added confusion with the last post.
To clarify the problems I encountered are two and the situation is the following:
1) vers. 16,793 (currently the latest steam version)
      It does not load all the Jpg files and some Png files
2) vers. 16,720
      Do not load the attached nihli.jpg file (and maybe someone else )

Thank you

Ad maiora

spacefractal

this is odd. Its seens its a color either the jpg or png format does not like under decompress or under copying, while its does load the same image pretty fine from the bmp format.

So its not a size or memory issue for sure (as its should fails on the bmp file).

Im is not sure what its happens, but must been some how a decompress error or a round error. im not sure. But im confirm.

Here is the project im tested it with and its failed on both the 2020 and the newest version, so its not a issue created recently:
https://www.dropbox.com/s/loppc80q85gmlcp/imageloaderror.zip?dl=0

PS. Im on purpose cropped it a bit for testing. If im blankout the size with one color, its load fine, so its not a size issue.

PPS. Also on some machines textures over 2k might crash on some devices, but not the case here.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello


Qedo

unfortunately with GLBasic IDE, Version: 16.947 is not fixed

Qedo

Code (glbasic) Select
unfortunately with GLBasic IDE, Version: 16.947 is not fixed

Or better now version 16.947 loads the png and jpg but not "nihil.png" that I have attached previously.
However it's a minor problem because I think something is wrong with that file.
Now I think it's okay.

erico


Qedo

GLB beta 16.947 correctly loads compression level 2-3-4-7-8-9 saved with Gimp