Author Topic: GLBasic Version 16.793 (Steam) does not load the jpg file and some png (confirm)  (Read 1719 times)

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
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
« Last Edit: 2021-Jul-11 by spacefractal »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10814
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
can you zip me a tiny project?

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
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

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10814
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Good find. It was a signed/unsigned error checking the first bytes of the file. I'll prepare an update.

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
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

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3956
    • View Profile
    • Space Fractal
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 and The beagle Jam.

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
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

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3956
    • View Profile
    • Space Fractal
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.
« Last Edit: 2021-Jul-11 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10814
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Get the beta branch: I fixed it, didn't I?

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
unfortunately with GLBasic IDE, Version: 16.947 is not fixed

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
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.
« Last Edit: 2021-Jul-14 by Qedo »

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4396
    • View Profile
    • FUED
Could it be the level of compression on the PNG?

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 350
  • to program what I have todo how should I program?
    • View Profile
GLB beta 16.947 correctly loads compression level 2-3-4-7-8-9 saved with Gimp
« Last Edit: 2021-Jul-14 by Qedo »