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 / PNG broken in Android, working on Desktop

Author
Message
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 11th Jan 2016 05:25

Soooo my problem is, some PNG files i use are working on my desktop,
but everytime i export them to android, they get some error.

Now... WHY?^^

ummm yeah...
it looks like this on the desktop:



it looks like this on android:




i know the PNG is somehow "broken"? or...
i dont know what exactly the main cause is.

IT IS SOMETHING with the PNG file where android says: "NO I DONT ACCEPT THAT SHIT" and desktop says "thats fine enough"
because: its the image. not my code.

so yeah...
help pls^^
Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 11th Jan 2016 05:27 Edited at: 11th Jan 2016 05:31
Android is case sensitive. Windows is not.

LoadImage ("pNG.png")

is not the same as

LoadImage("png.png")

Make sure you have defined your image files with the correct casing so android can accept it

So if your image in your media folder has the name.

CaPsOn.png

It needs to be LoadImage ("CaPsOn.png")

Sign up for NaGaCreMo!
Raizzan
9
Years of Service
User Offline
Joined: 28th Jan 2015
Location:
Posted: 11th Jan 2016 06:05 Edited at: 11th Jan 2016 11:45
ha..

well i knew that android is case senstive and i knew the files were written correcty, in the code and in the data name.

But i never had thought it would be the ENDING of the data.
But the endings were invisible.
So
I had to turn the endings visible first.
and see that gimp exported my sprites with ".PNG" instead of ".png"
so
<MOD EDIT>
so
its Solved!


sooo
my file was:
"sprite.PNG"
and android wanted:
"sprite.png"



and

now im so happy i need a break
thanks
Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 11th Jan 2016 06:18
Quote: "But i never had thought it would be the ENDING of the data."

I would of never thought this either.

Glad you got it sorted

Sign up for NaGaCreMo!
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 11th Jan 2016 10:41
The case-sensitive filename issue has been covered many MANY times on the forums and continues to cause problems for people. I'd like to suggest a tweak to LoadImage so that by default it ignores case on all platforms, but has an optional parameter to switch case sensitive filenames on if you want. (something like: LoadImage( iImageIndex, sImageFilename, bBlackToAlpha, CaseSensitive ) where CaseSensitive can be 0 for off, 1 for on).

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 11th Jan 2016 11:36
@paul
it would help if the debugger write a log at pc/ide if the load filename did not match the media filename.
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Jan 2016 11:39 Edited at: 11th Jan 2016 11:42
It isn't AppGameKit that is case sensitive, it's the operating system. Having a flag in AppGameKit wouldn't work as the operating system is what's at fault. (Fault is a bad choice, as it's doing nothing wrong.)

I downloaded a mass file renamer which I run to rename every file in the media folder to lowercase before creating an apk. I'd suggest everyone else does too. Perhaps tgc should make it part of the apk process? I always put in any/all load media commands to load in lowercase, so having a tool to automatically run to make all files lowercase would suit me.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Jan 2016 11:46
Raizzan, this is a family-rated forum. No more bad language please.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 11th Jan 2016 12:24
Quote: "It isn't AppGameKit that is case sensitive, it's the operating system. Having a flag in AppGameKit wouldn't work as the operating system is what's at fault."

It is very simple to code around (use upper(string) when comparing the filenames?) and quite feasible to have a flag IMO. You may get an occurance of multiple files with the same name but different case which would cause a problem, but that's why you'd use the CaseSensitive flag (otherwise the first found would be used perhaps?).



V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Jan 2016 16:39
Android is the most annoying platform in this regard. I tried to make everything case insensitive but the NDK doesn't provide a way to get a list of files in the APK media folder, so I can't compare them to the filename you are trying to load to find the correct file.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Jan 2016 16:47
Quote: ""It isn't AppGameKit that is case sensitive, it's the operating system. Having a flag in AppGameKit wouldn't work as the operating system is what's at fault.""


Quote: "NDK doesn't provide a way to get a list of files in the APK media folder, so I can't compare them to the filename you are trying to load to find the correct file."


See. lol
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 11th Jan 2016 17:14
Oh I see the problem now Sounds like a challenge!

Can you get to the APK via /data/app and read it as a ZIP to get to the media folder?

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
mrradd
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: CA, USA
Posted: 11th Jan 2016 19:33 Edited at: 11th Jan 2016 19:35
I used to develop for Flash. Same exact problem with *.PNG vs *.png or even *.[ANYTHING_IN_CAPS] etc... Game breaking problems that are hard to find, but are really minor fixes, are the best! Just imagine if you didn't write ".PNG" in your initial question. It might have gone unsolved
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 12th Jan 2016 13:44
Personally I would prefer if AppGameKit would just post a message "Cannot find image.png" instead of running like there wasn't a problem and showing that missing image image. Or at least show the message and then run.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 12th Jan 2016 14:08
Quote: "Personally I would prefer if AppGameKit would just post a message "Cannot find image.png" instead of running like there wasn't a problem and showing that missing image image. Or at least show the message and then run."

Does SetErrorMode( 1 ) do this?
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 12th Jan 2016 16:21
What speaks against to message case-sensitive at pc at testing?
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 12th Jan 2016 17:03
Quote: "What speaks against to message case-sensitive at pc at testing?"
Does not compute
V2 T1 (Mostly)
Phone Tap!
Uzmadesign
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 12th Jan 2016 20:04
Quote: "What speaks against to message case-sensitive at pc at testing?"

i think he's saying that the windows version could generate a message (in the log) when the case of the filename and the coded filename do not match (a very good idea i think)

Sign up for NaGaCreMo!
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 13th Jan 2016 13:25
Quote: "Does SetErrorMode( 1 ) do this?"


Don't know. I didn't know about that command.
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 13th Jan 2016 16:04 Edited at: 13th Jan 2016 16:05
Quote: ""Does SetErrorMode( 1 ) do this?""

not really, it will say file not found and you still wonder why.
and at pc there is no error message, only at mobile in this case.

@blink0k,that is exact what i mean.
AGK (Steam) V2.0.16 : Windows 10 Pro 64 Bit : AMD (15.30.1025) Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)

Login to post a reply

Server time is: 2024-11-17 02:57:49
Your offset time is: 2024-11-17 02:57:49