Author Topic: Why will QB64 not load this image?  (Read 4409 times)

0 Members and 1 Guest are viewing this topic.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Why will QB64 not load this image?
« on: December 02, 2018, 02:12:42 pm »
its a good image, my graphics software loads it just fine. the BMP verison works fine with QB64 but the JPG version wont load.
its only this image that is not working, other JPGs, BMPs, and PNGs made by the same software all work fine. so why does this one image not load? What am I missing? Is my copy of QB64 the only one that wont load it?

Layer& = _LOADIMAGE("Networking.jpg", 32)
print layer&

output: "-1" which is a failed load

the PNG of this image is 5x the size, thats why I wanted to use the JPG version.
« Last Edit: December 02, 2018, 02:15:28 pm by Cobalt »
Granted after becoming radioactive I only have a half-life!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Why will QB64 not load this image?
« Reply #1 on: December 02, 2018, 02:21:44 pm »
Kind of dark, what if you loaded into PAINT and saved it under a different format (and size?).

FellippeHeitor

  • Guest
Re: Why will QB64 not load this image?
« Reply #2 on: December 02, 2018, 02:22:41 pm »
We just link to external libraries for image and sound decoding, which means that no decoding is done by qb64 itself, so that's just a case of a subformat not accepted by one of these libs.

It's highly likely that you'll be able to load it with QB64 after loading your Pic with a simpler image editor like ms-paint and then saving it, no changes required, as that's likely to save it with a more compliant/common subformat.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Why will QB64 not load this image?
« Reply #3 on: December 02, 2018, 02:36:37 pm »
Kind of dark, what if you loaded into PAINT and saved it under a different format (and size?).

using the same software that made the JPG saved as PNG loads fine, but the PNG comes out at 316k where as the JPG is 60k. the bmp is 901k. my GFX file now is 320k so to use the png would double that. just for one file. this is for battle ship, and the current version GFX file has jpgs already made by my software that work. just this one image that wont work as jpg. makin me scratch my head.
Never happened before thats all, wondering if its just a hiccup in my machine or if other people can't load that file too.

changed a pixel(literally 1 pixel) and re-saved now it loads fine.
Granted after becoming radioactive I only have a half-life!

FellippeHeitor

  • Guest
Re: Why will QB64 not load this image?
« Reply #4 on: December 02, 2018, 06:59:44 pm »
So I did like I (and bplus) had suggested you. Loaded your image in MS-Paint, changed *nothing* and saved.

QB64 loaded it fine.

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: Why will QB64 not load this image?
« Reply #5 on: December 02, 2018, 09:57:35 pm »
Didn't install MS Paint. have never used it, ever, in its 33 year existence. So I don't bother allowing it to install. and if it tries I delete it.
Granted after becoming radioactive I only have a half-life!

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Why will QB64 not load this image?
« Reply #6 on: December 03, 2018, 01:58:48 am »
I've made the image a bit lighter if that helps... Kept it as jpg, but the modification, has increased its size...

J

ps: The png version is about 3x the memory size....

pss: I could probably remove the white rectangle if you'd like...
« Last Edit: December 03, 2018, 02:06:49 am by johnno56 »
Logic is the beginning of wisdom.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Why will QB64 not load this image?
« Reply #7 on: December 03, 2018, 02:29:34 am »
As suggested... No rectangle...

J
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Why will QB64 not load this image?
« Reply #8 on: December 03, 2018, 10:06:15 am »
I suspect this is an opening screen and the "rectangle" might be for a title?


Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Why will QB64 not load this image?
« Reply #9 on: December 03, 2018, 01:38:40 pm »
Hi
Just to do a question about QB64 loading image issue...

On doing assets of a game with images (PNG or JPG) if I have a trouble that in a second time I solve with PAINT trick,
when my files arrives in another PC (Windows, Mac, Linux) is it possible that the issue comes back again?

Thanks
Programming isn't difficult, only it's  consuming time and coffee

FellippeHeitor

  • Guest
Re: Why will QB64 not load this image?
« Reply #10 on: December 03, 2018, 01:45:09 pm »
If QB64 loads an image on a machine it'll load it everywhere else, unless it got corrupted in transmission.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Why will QB64 not load this image?
« Reply #11 on: December 03, 2018, 02:29:33 pm »
thanks
Programming isn't difficult, only it's  consuming time and coffee