Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] [C++ Linux] LoadSprite fails to load png ?

Author
Message
DuckHP
6
Years of Service
User Offline
Joined: 1st Aug 2017
Location: Norway
Posted: 30th Aug 2018 19:36 Edited at: 30th Aug 2018 19:43
when trying to load the background.png used in the BumbleBee tutorial; Upon launch i get this error:



It's the exact same "background.png", i simply renamed it to "bg.png" .

In following the Tier 2 tutorial, my code is as follows:



Everything else seems to work as expected ..

The author of this post has marked a post as an answer.

Go to answer

puzzler2018
User Banned
Posted: 30th Aug 2018 19:43
Check for case sensitivity, is it really "bg.png" or maybe "bg.PNG"???

DuckHP
6
Years of Service
User Offline
Joined: 1st Aug 2017
Location: Norway
Posted: 30th Aug 2018 19:48 Edited at: 30th Aug 2018 19:48
puzzler2018 wrote: "Check for case sensitivity, is it really "bg.png" or maybe "bg.PNG"???"


Definitely sure since both code snippets are copy-pastes from the termina andl the source file
puzzler2018
User Banned
Posted: 30th Aug 2018 19:51
and the image is definitely in

/home/<username>/<project path/<executable's location>/media/

and called bg.png

all lower case

DuckHP
6
Years of Service
User Offline
Joined: 1st Aug 2017
Location: Norway
Posted: 30th Aug 2018 19:58 Edited at: 30th Aug 2018 21:05
This post has been marked by the post author as the answer.
Yes. However, turns out i'm quite the tosser

Apparently, when i was having my morning coffee, my brain somehow must have assumed they were both png's when copying the image..and thus decided to make my fingers type "mv background.jpg bg.png"

The 'background' is actually a jpg file , while the bumblebee sprite is png..

(which i guess would explain the "JPEG Error: 55" i got when trying to LoadSprite the converted (NOT)png-to-bmp ..)

FORGET YOU EVER SAW THIS! LOOK AWAY!
puzzler2018
User Banned
Posted: 30th Aug 2018 20:03
lol


so we good!!
DuckHP
6
Years of Service
User Offline
Joined: 1st Aug 2017
Location: Norway
Posted: 30th Aug 2018 20:32 Edited at: 30th Aug 2018 20:47
Yes

And should anyone who've, however unlikely, having made the same stupid mistake .. ffprobe is a nice tool to check actual format

In this case, the 'png' file proved itself being a jpg, since
Quote: "$ ffprobe game/media/bg.png"

gave
Quote: "Input #0, image2, from 'game/media/bg.png':
Duration: 00:00:00.04, start: 0.000000, bitrate: 3916 kb/s
Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1024x768 [SAR 72:72 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
"

While an actual png image should return something like:
Quote: "Input #0, png_pipe, from 'game/media/bg.png':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: png, rgb24(pc), 1024x768 [SAR 2834:2834 DAR 4:3], 25 tbr, 25 tbn, 25 tbc"
puzzler2018
User Banned
Posted: 30th Aug 2018 20:33
NIce feedback for all the linux guys and gals

Login to post a reply

Server time is: 2024-04-25 18:33:00
Your offset time is: 2024-04-25 18:33:00