iPhone/haXe/Loader = Runtime Crash

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

iPhone/haXe/Loader = Runtime Crash

Blue Sans douze
Hello !

I'm currently targetting the iPhone OS using haXe and XCode, and I
can't figure out how to load a png which is store at the same level as
the app binary.

This is the code I used :
                var l = new Loader();
                l.load(new URLRequest("icon.png"));
                addChild(l);

It's also my application icon (so the image itself is working). It's
96x96 pixels, and it's shipped with the application.

When I launch the application, gdb says :
warning: Unable to read symbols for
"/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
com.me.lightup [lightup] (478.52)
And away we go...
libpng error: CgBI: unknown critical chunk
Terminal error invalid kind, File draw_object.cpp, line 1809

And then the application crashes (the iPod return to springboard).

I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.

How can I load an image into my application then ?
Thanks.
Blue112.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Blue Sans douze
Note that with the very lastest NME and Neash (from SVN), I get the
same error. (when I try to update hxcpp, I can't compile it)

2010/2/19 Blue Sans douze <[hidden email]>:

> Hello !
>
> I'm currently targetting the iPhone OS using haXe and XCode, and I
> can't figure out how to load a png which is store at the same level as
> the app binary.
>
> This is the code I used :
>                var l = new Loader();
>                l.load(new URLRequest("icon.png"));
>                addChild(l);
>
> It's also my application icon (so the image itself is working). It's
> 96x96 pixels, and it's shipped with the application.
>
> When I launch the application, gdb says :
> warning: Unable to read symbols for
> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
> com.me.lightup [lightup] (478.52)
> And away we go...
> libpng error: CgBI: unknown critical chunk
> Terminal error invalid kind, File draw_object.cpp, line 1809
>
> And then the application crashes (the iPod return to springboard).
>
> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>
> How can I load an image into my application then ?
> Thanks.
> Blue112.
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Tony Polinelli
i had issues loading images with the iphone also, once i got an image
loaded (a png i think) it came out black and white. I dont think nme
has been fixed since then. I know that Hugh is working on a new
version of nme for the iphone at the moment, which should fix these
issues and work a lot faster.
I'm sure he could comment in more details, but i think you might need
to wait a few weeks till it is updated



On Sat, Feb 20, 2010 at 2:15 AM, Blue Sans douze
<[hidden email]> wrote:

> Note that with the very lastest NME and Neash (from SVN), I get the
> same error. (when I try to update hxcpp, I can't compile it)
>
> 2010/2/19 Blue Sans douze <[hidden email]>:
>> Hello !
>>
>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>> can't figure out how to load a png which is store at the same level as
>> the app binary.
>>
>> This is the code I used :
>>                var l = new Loader();
>>                l.load(new URLRequest("icon.png"));
>>                addChild(l);
>>
>> It's also my application icon (so the image itself is working). It's
>> 96x96 pixels, and it's shipped with the application.
>>
>> When I launch the application, gdb says :
>> warning: Unable to read symbols for
>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>> com.me.lightup [lightup] (478.52)
>> And away we go...
>> libpng error: CgBI: unknown critical chunk
>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>
>> And then the application crashes (the iPod return to springboard).
>>
>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>
>> How can I load an image into my application then ?
>> Thanks.
>> Blue112.
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Gamehaxe
In reply to this post by Blue Sans douze
Hi,

There is a shortcut for loading images on NME, using BitmapData directly:

static public function Load(inFilename:String) : BitmapData

This avoids the URL code, and should work better.
But as Tony has pointed out, the may be an issue to do with 24/32 bits
per pixels that causes the image to come out with funny colours.
You may be able to fix this with encoding choices - or maybe not.

Also and Tony says, I'm working on a re-write of NME to make it
more efficient and remove GPL code so I'm reluctant to do too
much work in the old code.

The new code has reached some kind of Alpha, where I can run the Box2D
code (3x performance improvement !  But that is a bit of  a pathological
case, redrawing everything every time), and I hope for some sort of
Beta mid-march and shortly after that,I'm hoping that it will be
"at least better than" the old code.

Anyhow, hope the BitmapData.Load works for you.

Hugh

>
> I'm currently targetting the iPhone OS using haXe and XCode, and I
> can't figure out how to load a png which is store at the same level as
> the app binary.
>
> This is the code I used :
> var l = new Loader();
> l.load(new URLRequest("icon.png"));
> addChild(l);
>
> It's also my application icon (so the image itself is working). It's
> 96x96 pixels, and it's shipped with the application.
>
> When I launch the application, gdb says :
> warning: Unable to read symbols for
> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
> com.me.lightup [lightup] (478.52)
> And away we go...
> libpng error: CgBI: unknown critical chunk
> Terminal error invalid kind, File draw_object.cpp, line 1809
>
> And then the application crashes (the iPod return to springboard).
>
> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>
> How can I load an image into my application then ?
> Thanks.
> Blue112.
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Blue Sans douze
That sounds great !

I hope the new code will be able to run flash-friendly haXe lib (like
TweenerHX, which is a really good tweening lib).
It would be nice to have a small howto for using that code as soon as
it be usable (even if it isn't really stable).
It would be great too to have a haxe.org/api like to know which
classes/methods are fully or partially supported.

I'll try that BitmapData.Load as soon as I can.
About that "tip", is there a place where all that things are
referenced ? I mean, I haven't find out anything of that with my
search on the web and the mailing list... I should look into the code
for finding out that way to do :p ? Sounds hard.

Thanks.
Blue112

2010/2/20 Hugh Sanderson <[hidden email]>:

> Hi,
>
> There is a shortcut for loading images on NME, using BitmapData directly:
>
> static public function Load(inFilename:String) : BitmapData
>
> This avoids the URL code, and should work better.
> But as Tony has pointed out, the may be an issue to do with 24/32 bits
> per pixels that causes the image to come out with funny colours.
> You may be able to fix this with encoding choices - or maybe not.
>
> Also and Tony says, I'm working on a re-write of NME to make it
> more efficient and remove GPL code so I'm reluctant to do too
> much work in the old code.
>
> The new code has reached some kind of Alpha, where I can run the Box2D
> code (3x performance improvement !  But that is a bit of  a pathological
> case, redrawing everything every time), and I hope for some sort of
> Beta mid-march and shortly after that,I'm hoping that it will be
> "at least better than" the old code.
>
> Anyhow, hope the BitmapData.Load works for you.
>
> Hugh
>
>>
>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>> can't figure out how to load a png which is store at the same level as
>> the app binary.
>>
>> This is the code I used :
>>                var l = new Loader();
>>                l.load(new URLRequest("icon.png"));
>>                addChild(l);
>>
>> It's also my application icon (so the image itself is working). It's
>> 96x96 pixels, and it's shipped with the application.
>>
>> When I launch the application, gdb says :
>> warning: Unable to read symbols for
>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>> com.me.lightup [lightup] (478.52)
>> And away we go...
>> libpng error: CgBI: unknown critical chunk
>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>
>> And then the application crashes (the iPod return to springboard).
>>
>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>
>> How can I load an image into my application then ?
>> Thanks.
>> Blue112.
>>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Tony Polinelli
Since the iphone target is so new and not yet really that complete
(and also currently being redeveloped from scratch as we speak) -
there currently isnt really any documentation.

I look into the neash/nme code to see if a function is complete- of
what other functions are available. You will notice that the flash api
has been replicated, but other useful functions are available - these
have Captial naming as opposed to camelCase. This would be the best
way to get an idea of whats available.





On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
<[hidden email]> wrote:

> That sounds great !
>
> I hope the new code will be able to run flash-friendly haXe lib (like
> TweenerHX, which is a really good tweening lib).
> It would be nice to have a small howto for using that code as soon as
> it be usable (even if it isn't really stable).
> It would be great too to have a haxe.org/api like to know which
> classes/methods are fully or partially supported.
>
> I'll try that BitmapData.Load as soon as I can.
> About that "tip", is there a place where all that things are
> referenced ? I mean, I haven't find out anything of that with my
> search on the web and the mailing list... I should look into the code
> for finding out that way to do :p ? Sounds hard.
>
> Thanks.
> Blue112
>
> 2010/2/20 Hugh Sanderson <[hidden email]>:
>> Hi,
>>
>> There is a shortcut for loading images on NME, using BitmapData directly:
>>
>> static public function Load(inFilename:String) : BitmapData
>>
>> This avoids the URL code, and should work better.
>> But as Tony has pointed out, the may be an issue to do with 24/32 bits
>> per pixels that causes the image to come out with funny colours.
>> You may be able to fix this with encoding choices - or maybe not.
>>
>> Also and Tony says, I'm working on a re-write of NME to make it
>> more efficient and remove GPL code so I'm reluctant to do too
>> much work in the old code.
>>
>> The new code has reached some kind of Alpha, where I can run the Box2D
>> code (3x performance improvement !  But that is a bit of  a pathological
>> case, redrawing everything every time), and I hope for some sort of
>> Beta mid-march and shortly after that,I'm hoping that it will be
>> "at least better than" the old code.
>>
>> Anyhow, hope the BitmapData.Load works for you.
>>
>> Hugh
>>
>>>
>>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>>> can't figure out how to load a png which is store at the same level as
>>> the app binary.
>>>
>>> This is the code I used :
>>>                var l = new Loader();
>>>                l.load(new URLRequest("icon.png"));
>>>                addChild(l);
>>>
>>> It's also my application icon (so the image itself is working). It's
>>> 96x96 pixels, and it's shipped with the application.
>>>
>>> When I launch the application, gdb says :
>>> warning: Unable to read symbols for
>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>> com.me.lightup [lightup] (478.52)
>>> And away we go...
>>> libpng error: CgBI: unknown critical chunk
>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>
>>> And then the application crashes (the iPod return to springboard).
>>>
>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>
>>> How can I load an image into my application then ?
>>> Thanks.
>>> Blue112.
>>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
Tony Polinelli
http://touchmypixel.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Blue Sans douze
When I use BitmapData.Load with a png file, I get this error in gdb :

libpng error: CgBI: unknown critical chunk

This is my code :
                var l = BitmapData.Load("icon.png");
                var b = new Bitmap(l);
                addChild(b);

Thanks !
Blue112.

2010/2/21 Tony Polinelli <[hidden email]>:

> Since the iphone target is so new and not yet really that complete
> (and also currently being redeveloped from scratch as we speak) -
> there currently isnt really any documentation.
>
> I look into the neash/nme code to see if a function is complete- of
> what other functions are available. You will notice that the flash api
> has been replicated, but other useful functions are available - these
> have Captial naming as opposed to camelCase. This would be the best
> way to get an idea of whats available.
>
>
>
>
>
> On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
> <[hidden email]> wrote:
>> That sounds great !
>>
>> I hope the new code will be able to run flash-friendly haXe lib (like
>> TweenerHX, which is a really good tweening lib).
>> It would be nice to have a small howto for using that code as soon as
>> it be usable (even if it isn't really stable).
>> It would be great too to have a haxe.org/api like to know which
>> classes/methods are fully or partially supported.
>>
>> I'll try that BitmapData.Load as soon as I can.
>> About that "tip", is there a place where all that things are
>> referenced ? I mean, I haven't find out anything of that with my
>> search on the web and the mailing list... I should look into the code
>> for finding out that way to do :p ? Sounds hard.
>>
>> Thanks.
>> Blue112
>>
>> 2010/2/20 Hugh Sanderson <[hidden email]>:
>>> Hi,
>>>
>>> There is a shortcut for loading images on NME, using BitmapData directly:
>>>
>>> static public function Load(inFilename:String) : BitmapData
>>>
>>> This avoids the URL code, and should work better.
>>> But as Tony has pointed out, the may be an issue to do with 24/32 bits
>>> per pixels that causes the image to come out with funny colours.
>>> You may be able to fix this with encoding choices - or maybe not.
>>>
>>> Also and Tony says, I'm working on a re-write of NME to make it
>>> more efficient and remove GPL code so I'm reluctant to do too
>>> much work in the old code.
>>>
>>> The new code has reached some kind of Alpha, where I can run the Box2D
>>> code (3x performance improvement !  But that is a bit of  a pathological
>>> case, redrawing everything every time), and I hope for some sort of
>>> Beta mid-march and shortly after that,I'm hoping that it will be
>>> "at least better than" the old code.
>>>
>>> Anyhow, hope the BitmapData.Load works for you.
>>>
>>> Hugh
>>>
>>>>
>>>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>>>> can't figure out how to load a png which is store at the same level as
>>>> the app binary.
>>>>
>>>> This is the code I used :
>>>>                var l = new Loader();
>>>>                l.load(new URLRequest("icon.png"));
>>>>                addChild(l);
>>>>
>>>> It's also my application icon (so the image itself is working). It's
>>>> 96x96 pixels, and it's shipped with the application.
>>>>
>>>> When I launch the application, gdb says :
>>>> warning: Unable to read symbols for
>>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>>> com.me.lightup [lightup] (478.52)
>>>> And away we go...
>>>> libpng error: CgBI: unknown critical chunk
>>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>>
>>>> And then the application crashes (the iPod return to springboard).
>>>>
>>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>>
>>>> How can I load an image into my application then ?
>>>> Thanks.
>>>> Blue112.
>>>>
>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>
> --
> Tony Polinelli
> http://touchmypixel.com
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Gamehaxe
Hi,
I guess the png may be in an unsupported format, or perhaps
it is betting transformed (binary -> ascii ?) when it is
downloaded to the phone or along the way.  Can you do a "properties" on the
file and get the dimensions, pits per pixel etc?
I presume you can load the file in a edit package?
But it looks to me like it may be corrupted at some stage.

Hugh

> When I use BitmapData.Load with a png file, I get this error in gdb :
>
> libpng error: CgBI: unknown critical chunk
>
> This is my code :
> var l = BitmapData.Load("icon.png");
> var b = new Bitmap(l);
> addChild(b);
>
> Thanks !
> Blue112.
>
> 2010/2/21 Tony Polinelli <[hidden email]>:
>> Since the iphone target is so new and not yet really that complete
>> (and also currently being redeveloped from scratch as we speak) -
>> there currently isnt really any documentation.
>>
>> I look into the neash/nme code to see if a function is complete- of
>> what other functions are available. You will notice that the flash api
>> has been replicated, but other useful functions are available - these
>> have Captial naming as opposed to camelCase. This would be the best
>> way to get an idea of whats available.
>>
>>
>>
>>
>>
>> On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
>> <[hidden email]> wrote:
>>> That sounds great !
>>>
>>> I hope the new code will be able to run flash-friendly haXe lib (like
>>> TweenerHX, which is a really good tweening lib).
>>> It would be nice to have a small howto for using that code as soon as
>>> it be usable (even if it isn't really stable).
>>> It would be great too to have a haxe.org/api like to know which
>>> classes/methods are fully or partially supported.
>>>
>>> I'll try that BitmapData.Load as soon as I can.
>>> About that "tip", is there a place where all that things are
>>> referenced ? I mean, I haven't find out anything of that with my
>>> search on the web and the mailing list... I should look into the code
>>> for finding out that way to do :p ? Sounds hard.
>>>
>>> Thanks.
>>> Blue112
>>>
>>> 2010/2/20 Hugh Sanderson <[hidden email]>:
>>>> Hi,
>>>>
>>>> There is a shortcut for loading images on NME, using BitmapData  
>>>> directly:
>>>>
>>>> static public function Load(inFilename:String) : BitmapData
>>>>
>>>> This avoids the URL code, and should work better.
>>>> But as Tony has pointed out, the may be an issue to do with 24/32 bits
>>>> per pixels that causes the image to come out with funny colours.
>>>> You may be able to fix this with encoding choices - or maybe not.
>>>>
>>>> Also and Tony says, I'm working on a re-write of NME to make it
>>>> more efficient and remove GPL code so I'm reluctant to do too
>>>> much work in the old code.
>>>>
>>>> The new code has reached some kind of Alpha, where I can run the Box2D
>>>> code (3x performance improvement !  But that is a bit of  a  
>>>> pathological
>>>> case, redrawing everything every time), and I hope for some sort of
>>>> Beta mid-march and shortly after that,I'm hoping that it will be
>>>> "at least better than" the old code.
>>>>
>>>> Anyhow, hope the BitmapData.Load works for you.
>>>>
>>>> Hugh
>>>>
>>>>>
>>>>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>>>>> can't figure out how to load a png which is store at the same level  
>>>>> as
>>>>> the app binary.
>>>>>
>>>>> This is the code I used :
>>>>>                var l = new Loader();
>>>>>                l.load(new URLRequest("icon.png"));
>>>>>                addChild(l);
>>>>>
>>>>> It's also my application icon (so the image itself is working). It's
>>>>> 96x96 pixels, and it's shipped with the application.
>>>>>
>>>>> When I launch the application, gdb says :
>>>>> warning: Unable to read symbols for
>>>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>>>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>>>> com.me.lightup [lightup] (478.52)
>>>>> And away we go...
>>>>> libpng error: CgBI: unknown critical chunk
>>>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>>>
>>>>> And then the application crashes (the iPod return to springboard).
>>>>>
>>>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>>>
>>>>> How can I load an image into my application then ?
>>>>> Thanks.
>>>>> Blue112.
>>>>>
>>>>
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>
>>
>>
>> --
>> Tony Polinelli
>> http://touchmypixel.com
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Blue Sans douze
Hi again.

It's a regular png created with The Gimp, it's 96x96, RGB with a color
profile and no alpha channel.

I don't really know how I can find out the bits per pixels on Mac OS
(I'm really new on this OS, usually I'm on Linux).

Anyway, the file doesn't look corrupted since it's also used as the
program's icon, which is working.

Is there a way to know which format is supported ? PNG is a really
great format, I don't think there's a such powerful format.

Thanks anyway.
Blue112.

2010/2/22 Hugh Sanderson <[hidden email]>:

> Hi,
> I guess the png may be in an unsupported format, or perhaps
> it is betting transformed (binary -> ascii ?) when it is
> downloaded to the phone or along the way.  Can you do a "properties" on the
> file and get the dimensions, pits per pixel etc?
> I presume you can load the file in a edit package?
> But it looks to me like it may be corrupted at some stage.
>
> Hugh
>
>> When I use BitmapData.Load with a png file, I get this error in gdb :
>>
>> libpng error: CgBI: unknown critical chunk
>>
>> This is my code :
>>                var l = BitmapData.Load("icon.png");
>>                var b = new Bitmap(l);
>>                addChild(b);
>>
>> Thanks !
>> Blue112.
>>
>> 2010/2/21 Tony Polinelli <[hidden email]>:
>>>
>>> Since the iphone target is so new and not yet really that complete
>>> (and also currently being redeveloped from scratch as we speak) -
>>> there currently isnt really any documentation.
>>>
>>> I look into the neash/nme code to see if a function is complete- of
>>> what other functions are available. You will notice that the flash api
>>> has been replicated, but other useful functions are available - these
>>> have Captial naming as opposed to camelCase. This would be the best
>>> way to get an idea of whats available.
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
>>> <[hidden email]> wrote:
>>>>
>>>> That sounds great !
>>>>
>>>> I hope the new code will be able to run flash-friendly haXe lib (like
>>>> TweenerHX, which is a really good tweening lib).
>>>> It would be nice to have a small howto for using that code as soon as
>>>> it be usable (even if it isn't really stable).
>>>> It would be great too to have a haxe.org/api like to know which
>>>> classes/methods are fully or partially supported.
>>>>
>>>> I'll try that BitmapData.Load as soon as I can.
>>>> About that "tip", is there a place where all that things are
>>>> referenced ? I mean, I haven't find out anything of that with my
>>>> search on the web and the mailing list... I should look into the code
>>>> for finding out that way to do :p ? Sounds hard.
>>>>
>>>> Thanks.
>>>> Blue112
>>>>
>>>> 2010/2/20 Hugh Sanderson <[hidden email]>:
>>>>>
>>>>> Hi,
>>>>>
>>>>> There is a shortcut for loading images on NME, using BitmapData
>>>>> directly:
>>>>>
>>>>> static public function Load(inFilename:String) : BitmapData
>>>>>
>>>>> This avoids the URL code, and should work better.
>>>>> But as Tony has pointed out, the may be an issue to do with 24/32 bits
>>>>> per pixels that causes the image to come out with funny colours.
>>>>> You may be able to fix this with encoding choices - or maybe not.
>>>>>
>>>>> Also and Tony says, I'm working on a re-write of NME to make it
>>>>> more efficient and remove GPL code so I'm reluctant to do too
>>>>> much work in the old code.
>>>>>
>>>>> The new code has reached some kind of Alpha, where I can run the Box2D
>>>>> code (3x performance improvement !  But that is a bit of  a
>>>>> pathological
>>>>> case, redrawing everything every time), and I hope for some sort of
>>>>> Beta mid-march and shortly after that,I'm hoping that it will be
>>>>> "at least better than" the old code.
>>>>>
>>>>> Anyhow, hope the BitmapData.Load works for you.
>>>>>
>>>>> Hugh
>>>>>
>>>>>>
>>>>>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>>>>>> can't figure out how to load a png which is store at the same level as
>>>>>> the app binary.
>>>>>>
>>>>>> This is the code I used :
>>>>>>               var l = new Loader();
>>>>>>               l.load(new URLRequest("icon.png"));
>>>>>>               addChild(l);
>>>>>>
>>>>>> It's also my application icon (so the image itself is working). It's
>>>>>> 96x96 pixels, and it's shipped with the application.
>>>>>>
>>>>>> When I launch the application, gdb says :
>>>>>> warning: Unable to read symbols for
>>>>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>>>>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>>>>> com.me.lightup [lightup] (478.52)
>>>>>> And away we go...
>>>>>> libpng error: CgBI: unknown critical chunk
>>>>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>>>>
>>>>>> And then the application crashes (the iPod return to springboard).
>>>>>>
>>>>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>>>>
>>>>>> How can I load an image into my application then ?
>>>>>> Thanks.
>>>>>> Blue112.
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>
>>>
>>>
>>> --
>>> Tony Polinelli
>>> http://touchmypixel.com
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Gamehaxe
Hi,
Ok, if it works as the icon, then it is probably not corrupt!
I did remember reading somewhere that xcode somehow processes
png images - can't remember the details.

Ok, so I looked it up:

http://discussions.apple.com/message.jspa?messageID=8314150

The problem is that apple messes with the image.
So you could try the "rename" trick ("icon.notpng") or
the project switch outlined in the link above.

The next version of NME will use the native image loading code,
so hopefully this will not be an issue.

Hugh

> Hi again.
>
> It's a regular png created with The Gimp, it's 96x96, RGB with a color
> profile and no alpha channel.
>
> I don't really know how I can find out the bits per pixels on Mac OS
> (I'm really new on this OS, usually I'm on Linux).
>
> Anyway, the file doesn't look corrupted since it's also used as the
> program's icon, which is working.
>
> Is there a way to know which format is supported ? PNG is a really
> great format, I don't think there's a such powerful format.
>
> Thanks anyway.
> Blue112.
>
> 2010/2/22 Hugh Sanderson <[hidden email]>:
>> Hi,
>> I guess the png may be in an unsupported format, or perhaps
>> it is betting transformed (binary -> ascii ?) when it is
>> downloaded to the phone or along the way.  Can you do a "properties" on  
>> the
>> file and get the dimensions, pits per pixel etc?
>> I presume you can load the file in a edit package?
>> But it looks to me like it may be corrupted at some stage.
>>
>> Hugh
>>
>>> When I use BitmapData.Load with a png file, I get this error in gdb :
>>>
>>> libpng error: CgBI: unknown critical chunk
>>>
>>> This is my code :
>>>                var l = BitmapData.Load("icon.png");
>>>                var b = new Bitmap(l);
>>>                addChild(b);
>>>
>>> Thanks !
>>> Blue112.
>>>
>>> 2010/2/21 Tony Polinelli <[hidden email]>:
>>>>
>>>> Since the iphone target is so new and not yet really that complete
>>>> (and also currently being redeveloped from scratch as we speak) -
>>>> there currently isnt really any documentation.
>>>>
>>>> I look into the neash/nme code to see if a function is complete- of
>>>> what other functions are available. You will notice that the flash api
>>>> has been replicated, but other useful functions are available - these
>>>> have Captial naming as opposed to camelCase. This would be the best
>>>> way to get an idea of whats available.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
>>>> <[hidden email]> wrote:
>>>>>
>>>>> That sounds great !
>>>>>
>>>>> I hope the new code will be able to run flash-friendly haXe lib (like
>>>>> TweenerHX, which is a really good tweening lib).
>>>>> It would be nice to have a small howto for using that code as soon as
>>>>> it be usable (even if it isn't really stable).
>>>>> It would be great too to have a haxe.org/api like to know which
>>>>> classes/methods are fully or partially supported.
>>>>>
>>>>> I'll try that BitmapData.Load as soon as I can.
>>>>> About that "tip", is there a place where all that things are
>>>>> referenced ? I mean, I haven't find out anything of that with my
>>>>> search on the web and the mailing list... I should look into the code
>>>>> for finding out that way to do :p ? Sounds hard.
>>>>>
>>>>> Thanks.
>>>>> Blue112
>>>>>
>>>>> 2010/2/20 Hugh Sanderson <[hidden email]>:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> There is a shortcut for loading images on NME, using BitmapData
>>>>>> directly:
>>>>>>
>>>>>> static public function Load(inFilename:String) : BitmapData
>>>>>>
>>>>>> This avoids the URL code, and should work better.
>>>>>> But as Tony has pointed out, the may be an issue to do with 24/32  
>>>>>> bits
>>>>>> per pixels that causes the image to come out with funny colours.
>>>>>> You may be able to fix this with encoding choices - or maybe not.
>>>>>>
>>>>>> Also and Tony says, I'm working on a re-write of NME to make it
>>>>>> more efficient and remove GPL code so I'm reluctant to do too
>>>>>> much work in the old code.
>>>>>>
>>>>>> The new code has reached some kind of Alpha, where I can run the  
>>>>>> Box2D
>>>>>> code (3x performance improvement !  But that is a bit of  a
>>>>>> pathological
>>>>>> case, redrawing everything every time), and I hope for some sort of
>>>>>> Beta mid-march and shortly after that,I'm hoping that it will be
>>>>>> "at least better than" the old code.
>>>>>>
>>>>>> Anyhow, hope the BitmapData.Load works for you.
>>>>>>
>>>>>> Hugh
>>>>>>
>>>>>>>
>>>>>>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>>>>>>> can't figure out how to load a png which is store at the same  
>>>>>>> level as
>>>>>>> the app binary.
>>>>>>>
>>>>>>> This is the code I used :
>>>>>>>               var l = new Loader();
>>>>>>>               l.load(new URLRequest("icon.png"));
>>>>>>>               addChild(l);
>>>>>>>
>>>>>>> It's also my application icon (so the image itself is working).  
>>>>>>> It's
>>>>>>> 96x96 pixels, and it's shipped with the application.
>>>>>>>
>>>>>>> When I launch the application, gdb says :
>>>>>>> warning: Unable to read symbols for
>>>>>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>>>>>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>>>>>> com.me.lightup [lightup] (478.52)
>>>>>>> And away we go...
>>>>>>> libpng error: CgBI: unknown critical chunk
>>>>>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>>>>>
>>>>>>> And then the application crashes (the iPod return to springboard).
>>>>>>>
>>>>>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>>>>>
>>>>>>> How can I load an image into my application then ?
>>>>>>> Thanks.
>>>>>>> Blue112.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>>
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Tony Polinelli
>>>> http://touchmypixel.com
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Blue Sans douze
Ok, now I can load the image but it looks weird, as said before (with
vertical lines in black and white). I there a way I can load / modify
in gimp the image so it looks normal ?

Thanks.
Blue112.


2010/2/22 Hugh Sanderson <[hidden email]>:

> Hi,
> Ok, if it works as the icon, then it is probably not corrupt!
> I did remember reading somewhere that xcode somehow processes
> png images - can't remember the details.
>
> Ok, so I looked it up:
>
> http://discussions.apple.com/message.jspa?messageID=8314150
>
> The problem is that apple messes with the image.
> So you could try the "rename" trick ("icon.notpng") or
> the project switch outlined in the link above.
>
> The next version of NME will use the native image loading code,
> so hopefully this will not be an issue.
>
> Hugh
>
>> Hi again.
>>
>> It's a regular png created with The Gimp, it's 96x96, RGB with a color
>> profile and no alpha channel.
>>
>> I don't really know how I can find out the bits per pixels on Mac OS
>> (I'm really new on this OS, usually I'm on Linux).
>>
>> Anyway, the file doesn't look corrupted since it's also used as the
>> program's icon, which is working.
>>
>> Is there a way to know which format is supported ? PNG is a really
>> great format, I don't think there's a such powerful format.
>>
>> Thanks anyway.
>> Blue112.
>>
>> 2010/2/22 Hugh Sanderson <[hidden email]>:
>>>
>>> Hi,
>>> I guess the png may be in an unsupported format, or perhaps
>>> it is betting transformed (binary -> ascii ?) when it is
>>> downloaded to the phone or along the way.  Can you do a "properties" on
>>> the
>>> file and get the dimensions, pits per pixel etc?
>>> I presume you can load the file in a edit package?
>>> But it looks to me like it may be corrupted at some stage.
>>>
>>> Hugh
>>>
>>>> When I use BitmapData.Load with a png file, I get this error in gdb :
>>>>
>>>> libpng error: CgBI: unknown critical chunk
>>>>
>>>> This is my code :
>>>>               var l = BitmapData.Load("icon.png");
>>>>               var b = new Bitmap(l);
>>>>               addChild(b);
>>>>
>>>> Thanks !
>>>> Blue112.
>>>>
>>>> 2010/2/21 Tony Polinelli <[hidden email]>:
>>>>>
>>>>> Since the iphone target is so new and not yet really that complete
>>>>> (and also currently being redeveloped from scratch as we speak) -
>>>>> there currently isnt really any documentation.
>>>>>
>>>>> I look into the neash/nme code to see if a function is complete- of
>>>>> what other functions are available. You will notice that the flash api
>>>>> has been replicated, but other useful functions are available - these
>>>>> have Captial naming as opposed to camelCase. This would be the best
>>>>> way to get an idea of whats available.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
>>>>> <[hidden email]> wrote:
>>>>>>
>>>>>> That sounds great !
>>>>>>
>>>>>> I hope the new code will be able to run flash-friendly haXe lib (like
>>>>>> TweenerHX, which is a really good tweening lib).
>>>>>> It would be nice to have a small howto for using that code as soon as
>>>>>> it be usable (even if it isn't really stable).
>>>>>> It would be great too to have a haxe.org/api like to know which
>>>>>> classes/methods are fully or partially supported.
>>>>>>
>>>>>> I'll try that BitmapData.Load as soon as I can.
>>>>>> About that "tip", is there a place where all that things are
>>>>>> referenced ? I mean, I haven't find out anything of that with my
>>>>>> search on the web and the mailing list... I should look into the code
>>>>>> for finding out that way to do :p ? Sounds hard.
>>>>>>
>>>>>> Thanks.
>>>>>> Blue112
>>>>>>
>>>>>> 2010/2/20 Hugh Sanderson <[hidden email]>:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> There is a shortcut for loading images on NME, using BitmapData
>>>>>>> directly:
>>>>>>>
>>>>>>> static public function Load(inFilename:String) : BitmapData
>>>>>>>
>>>>>>> This avoids the URL code, and should work better.
>>>>>>> But as Tony has pointed out, the may be an issue to do with 24/32
>>>>>>> bits
>>>>>>> per pixels that causes the image to come out with funny colours.
>>>>>>> You may be able to fix this with encoding choices - or maybe not.
>>>>>>>
>>>>>>> Also and Tony says, I'm working on a re-write of NME to make it
>>>>>>> more efficient and remove GPL code so I'm reluctant to do too
>>>>>>> much work in the old code.
>>>>>>>
>>>>>>> The new code has reached some kind of Alpha, where I can run the
>>>>>>> Box2D
>>>>>>> code (3x performance improvement !  But that is a bit of  a
>>>>>>> pathological
>>>>>>> case, redrawing everything every time), and I hope for some sort of
>>>>>>> Beta mid-march and shortly after that,I'm hoping that it will be
>>>>>>> "at least better than" the old code.
>>>>>>>
>>>>>>> Anyhow, hope the BitmapData.Load works for you.
>>>>>>>
>>>>>>> Hugh
>>>>>>>
>>>>>>>>
>>>>>>>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>>>>>>>> can't figure out how to load a png which is store at the same level
>>>>>>>> as
>>>>>>>> the app binary.
>>>>>>>>
>>>>>>>> This is the code I used :
>>>>>>>>              var l = new Loader();
>>>>>>>>              l.load(new URLRequest("icon.png"));
>>>>>>>>              addChild(l);
>>>>>>>>
>>>>>>>> It's also my application icon (so the image itself is working). It's
>>>>>>>> 96x96 pixels, and it's shipped with the application.
>>>>>>>>
>>>>>>>> When I launch the application, gdb says :
>>>>>>>> warning: Unable to read symbols for
>>>>>>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>>>>>>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>>>>>>> com.me.lightup [lightup] (478.52)
>>>>>>>> And away we go...
>>>>>>>> libpng error: CgBI: unknown critical chunk
>>>>>>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>>>>>>
>>>>>>>> And then the application crashes (the iPod return to springboard).
>>>>>>>>
>>>>>>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>>>>>>
>>>>>>>> How can I load an image into my application then ?
>>>>>>>> Thanks.
>>>>>>>> Blue112.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> haXe - an open source web programming language
>>>>>>> http://haxe.org
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Tony Polinelli
>>>>> http://touchmypixel.com
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Gamehaxe
Not sure.  Does it have an alpha channel?  Perhaps you could
add one if it does not - worth a try.

Hugh

> Ok, now I can load the image but it looks weird, as said before (with
> vertical lines in black and white). I there a way I can load / modify
> in gimp the image so it looks normal ?
>
> Thanks.
> Blue112.
>
>
> 2010/2/22 Hugh Sanderson <[hidden email]>:
>> Hi,
>> Ok, if it works as the icon, then it is probably not corrupt!
>> I did remember reading somewhere that xcode somehow processes
>> png images - can't remember the details.
>>
>> Ok, so I looked it up:
>>
>> http://discussions.apple.com/message.jspa?messageID=8314150
>>
>> The problem is that apple messes with the image.
>> So you could try the "rename" trick ("icon.notpng") or
>> the project switch outlined in the link above.
>>
>> The next version of NME will use the native image loading code,
>> so hopefully this will not be an issue.
>>
>> Hugh
>>
>>> Hi again.
>>>
>>> It's a regular png created with The Gimp, it's 96x96, RGB with a color
>>> profile and no alpha channel.
>>>
>>> I don't really know how I can find out the bits per pixels on Mac OS
>>> (I'm really new on this OS, usually I'm on Linux).
>>>
>>> Anyway, the file doesn't look corrupted since it's also used as the
>>> program's icon, which is working.
>>>
>>> Is there a way to know which format is supported ? PNG is a really
>>> great format, I don't think there's a such powerful format.
>>>
>>> Thanks anyway.
>>> Blue112.
>>>
>>> 2010/2/22 Hugh Sanderson <[hidden email]>:
>>>>
>>>> Hi,
>>>> I guess the png may be in an unsupported format, or perhaps
>>>> it is betting transformed (binary -> ascii ?) when it is
>>>> downloaded to the phone or along the way.  Can you do a "properties"  
>>>> on
>>>> the
>>>> file and get the dimensions, pits per pixel etc?
>>>> I presume you can load the file in a edit package?
>>>> But it looks to me like it may be corrupted at some stage.
>>>>
>>>> Hugh
>>>>
>>>>> When I use BitmapData.Load with a png file, I get this error in gdb :
>>>>>
>>>>> libpng error: CgBI: unknown critical chunk
>>>>>
>>>>> This is my code :
>>>>>               var l = BitmapData.Load("icon.png");
>>>>>               var b = new Bitmap(l);
>>>>>               addChild(b);
>>>>>
>>>>> Thanks !
>>>>> Blue112.
>>>>>
>>>>> 2010/2/21 Tony Polinelli <[hidden email]>:
>>>>>>
>>>>>> Since the iphone target is so new and not yet really that complete
>>>>>> (and also currently being redeveloped from scratch as we speak) -
>>>>>> there currently isnt really any documentation.
>>>>>>
>>>>>> I look into the neash/nme code to see if a function is complete- of
>>>>>> what other functions are available. You will notice that the flash  
>>>>>> api
>>>>>> has been replicated, but other useful functions are available -  
>>>>>> these
>>>>>> have Captial naming as opposed to camelCase. This would be the best
>>>>>> way to get an idea of whats available.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
>>>>>> <[hidden email]> wrote:
>>>>>>>
>>>>>>> That sounds great !
>>>>>>>
>>>>>>> I hope the new code will be able to run flash-friendly haXe lib  
>>>>>>> (like
>>>>>>> TweenerHX, which is a really good tweening lib).
>>>>>>> It would be nice to have a small howto for using that code as soon  
>>>>>>> as
>>>>>>> it be usable (even if it isn't really stable).
>>>>>>> It would be great too to have a haxe.org/api like to know which
>>>>>>> classes/methods are fully or partially supported.
>>>>>>>
>>>>>>> I'll try that BitmapData.Load as soon as I can.
>>>>>>> About that "tip", is there a place where all that things are
>>>>>>> referenced ? I mean, I haven't find out anything of that with my
>>>>>>> search on the web and the mailing list... I should look into the  
>>>>>>> code
>>>>>>> for finding out that way to do :p ? Sounds hard.
>>>>>>>
>>>>>>> Thanks.
>>>>>>> Blue112
>>>>>>>
>>>>>>> 2010/2/20 Hugh Sanderson <[hidden email]>:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> There is a shortcut for loading images on NME, using BitmapData
>>>>>>>> directly:
>>>>>>>>
>>>>>>>> static public function Load(inFilename:String) : BitmapData
>>>>>>>>
>>>>>>>> This avoids the URL code, and should work better.
>>>>>>>> But as Tony has pointed out, the may be an issue to do with 24/32
>>>>>>>> bits
>>>>>>>> per pixels that causes the image to come out with funny colours.
>>>>>>>> You may be able to fix this with encoding choices - or maybe not.
>>>>>>>>
>>>>>>>> Also and Tony says, I'm working on a re-write of NME to make it
>>>>>>>> more efficient and remove GPL code so I'm reluctant to do too
>>>>>>>> much work in the old code.
>>>>>>>>
>>>>>>>> The new code has reached some kind of Alpha, where I can run the
>>>>>>>> Box2D
>>>>>>>> code (3x performance improvement !  But that is a bit of  a
>>>>>>>> pathological
>>>>>>>> case, redrawing everything every time), and I hope for some sort  
>>>>>>>> of
>>>>>>>> Beta mid-march and shortly after that,I'm hoping that it will be
>>>>>>>> "at least better than" the old code.
>>>>>>>>
>>>>>>>> Anyhow, hope the BitmapData.Load works for you.
>>>>>>>>
>>>>>>>> Hugh
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I'm currently targetting the iPhone OS using haXe and XCode, and  
>>>>>>>>> I
>>>>>>>>> can't figure out how to load a png which is store at the same  
>>>>>>>>> level
>>>>>>>>> as
>>>>>>>>> the app binary.
>>>>>>>>>
>>>>>>>>> This is the code I used :
>>>>>>>>>              var l = new Loader();
>>>>>>>>>              l.load(new URLRequest("icon.png"));
>>>>>>>>>              addChild(l);
>>>>>>>>>
>>>>>>>>> It's also my application icon (so the image itself is working).  
>>>>>>>>> It's
>>>>>>>>> 96x96 pixels, and it's shipped with the application.
>>>>>>>>>
>>>>>>>>> When I launch the application, gdb says :
>>>>>>>>> warning: Unable to read symbols for
>>>>>>>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not  
>>>>>>>>> found).
>>>>>>>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>>>>>>>> com.me.lightup [lightup] (478.52)
>>>>>>>>> And away we go...
>>>>>>>>> libpng error: CgBI: unknown critical chunk
>>>>>>>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>>>>>>>
>>>>>>>>> And then the application crashes (the iPod return to  
>>>>>>>>> springboard).
>>>>>>>>>
>>>>>>>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>>>>>>>
>>>>>>>>> How can I load an image into my application then ?
>>>>>>>>> Thanks.
>>>>>>>>> Blue112.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> haXe - an open source web programming language
>>>>>>>> http://haxe.org
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> haXe - an open source web programming language
>>>>>>> http://haxe.org
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Tony Polinelli
>>>>>> http://touchmypixel.com
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>>
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: iPhone/haXe/Loader = Runtime Crash

Blue Sans douze
It didn't.
I had one, and it works wonderfully !

Hiya, that's great.
Thanks again.
Blue112.

2010/2/22 Hugh Sanderson <[hidden email]>:

> Not sure.  Does it have an alpha channel?  Perhaps you could
> add one if it does not - worth a try.
>
> Hugh
>
>> Ok, now I can load the image but it looks weird, as said before (with
>> vertical lines in black and white). I there a way I can load / modify
>> in gimp the image so it looks normal ?
>>
>> Thanks.
>> Blue112.
>>
>>
>> 2010/2/22 Hugh Sanderson <[hidden email]>:
>>>
>>> Hi,
>>> Ok, if it works as the icon, then it is probably not corrupt!
>>> I did remember reading somewhere that xcode somehow processes
>>> png images - can't remember the details.
>>>
>>> Ok, so I looked it up:
>>>
>>> http://discussions.apple.com/message.jspa?messageID=8314150
>>>
>>> The problem is that apple messes with the image.
>>> So you could try the "rename" trick ("icon.notpng") or
>>> the project switch outlined in the link above.
>>>
>>> The next version of NME will use the native image loading code,
>>> so hopefully this will not be an issue.
>>>
>>> Hugh
>>>
>>>> Hi again.
>>>>
>>>> It's a regular png created with The Gimp, it's 96x96, RGB with a color
>>>> profile and no alpha channel.
>>>>
>>>> I don't really know how I can find out the bits per pixels on Mac OS
>>>> (I'm really new on this OS, usually I'm on Linux).
>>>>
>>>> Anyway, the file doesn't look corrupted since it's also used as the
>>>> program's icon, which is working.
>>>>
>>>> Is there a way to know which format is supported ? PNG is a really
>>>> great format, I don't think there's a such powerful format.
>>>>
>>>> Thanks anyway.
>>>> Blue112.
>>>>
>>>> 2010/2/22 Hugh Sanderson <[hidden email]>:
>>>>>
>>>>> Hi,
>>>>> I guess the png may be in an unsupported format, or perhaps
>>>>> it is betting transformed (binary -> ascii ?) when it is
>>>>> downloaded to the phone or along the way.  Can you do a "properties" on
>>>>> the
>>>>> file and get the dimensions, pits per pixel etc?
>>>>> I presume you can load the file in a edit package?
>>>>> But it looks to me like it may be corrupted at some stage.
>>>>>
>>>>> Hugh
>>>>>
>>>>>> When I use BitmapData.Load with a png file, I get this error in gdb :
>>>>>>
>>>>>> libpng error: CgBI: unknown critical chunk
>>>>>>
>>>>>> This is my code :
>>>>>>              var l = BitmapData.Load("icon.png");
>>>>>>              var b = new Bitmap(l);
>>>>>>              addChild(b);
>>>>>>
>>>>>> Thanks !
>>>>>> Blue112.
>>>>>>
>>>>>> 2010/2/21 Tony Polinelli <[hidden email]>:
>>>>>>>
>>>>>>> Since the iphone target is so new and not yet really that complete
>>>>>>> (and also currently being redeveloped from scratch as we speak) -
>>>>>>> there currently isnt really any documentation.
>>>>>>>
>>>>>>> I look into the neash/nme code to see if a function is complete- of
>>>>>>> what other functions are available. You will notice that the flash
>>>>>>> api
>>>>>>> has been replicated, but other useful functions are available - these
>>>>>>> have Captial naming as opposed to camelCase. This would be the best
>>>>>>> way to get an idea of whats available.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Sun, Feb 21, 2010 at 1:37 PM, Blue Sans douze
>>>>>>> <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> That sounds great !
>>>>>>>>
>>>>>>>> I hope the new code will be able to run flash-friendly haXe lib
>>>>>>>> (like
>>>>>>>> TweenerHX, which is a really good tweening lib).
>>>>>>>> It would be nice to have a small howto for using that code as soon
>>>>>>>> as
>>>>>>>> it be usable (even if it isn't really stable).
>>>>>>>> It would be great too to have a haxe.org/api like to know which
>>>>>>>> classes/methods are fully or partially supported.
>>>>>>>>
>>>>>>>> I'll try that BitmapData.Load as soon as I can.
>>>>>>>> About that "tip", is there a place where all that things are
>>>>>>>> referenced ? I mean, I haven't find out anything of that with my
>>>>>>>> search on the web and the mailing list... I should look into the
>>>>>>>> code
>>>>>>>> for finding out that way to do :p ? Sounds hard.
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>> Blue112
>>>>>>>>
>>>>>>>> 2010/2/20 Hugh Sanderson <[hidden email]>:
>>>>>>>>>
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> There is a shortcut for loading images on NME, using BitmapData
>>>>>>>>> directly:
>>>>>>>>>
>>>>>>>>> static public function Load(inFilename:String) : BitmapData
>>>>>>>>>
>>>>>>>>> This avoids the URL code, and should work better.
>>>>>>>>> But as Tony has pointed out, the may be an issue to do with 24/32
>>>>>>>>> bits
>>>>>>>>> per pixels that causes the image to come out with funny colours.
>>>>>>>>> You may be able to fix this with encoding choices - or maybe not.
>>>>>>>>>
>>>>>>>>> Also and Tony says, I'm working on a re-write of NME to make it
>>>>>>>>> more efficient and remove GPL code so I'm reluctant to do too
>>>>>>>>> much work in the old code.
>>>>>>>>>
>>>>>>>>> The new code has reached some kind of Alpha, where I can run the
>>>>>>>>> Box2D
>>>>>>>>> code (3x performance improvement !  But that is a bit of  a
>>>>>>>>> pathological
>>>>>>>>> case, redrawing everything every time), and I hope for some sort of
>>>>>>>>> Beta mid-march and shortly after that,I'm hoping that it will be
>>>>>>>>> "at least better than" the old code.
>>>>>>>>>
>>>>>>>>> Anyhow, hope the BitmapData.Load works for you.
>>>>>>>>>
>>>>>>>>> Hugh
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I'm currently targetting the iPhone OS using haXe and XCode, and I
>>>>>>>>>> can't figure out how to load a png which is store at the same
>>>>>>>>>> level
>>>>>>>>>> as
>>>>>>>>>> the app binary.
>>>>>>>>>>
>>>>>>>>>> This is the code I used :
>>>>>>>>>>             var l = new Loader();
>>>>>>>>>>             l.load(new URLRequest("icon.png"));
>>>>>>>>>>             addChild(l);
>>>>>>>>>>
>>>>>>>>>> It's also my application icon (so the image itself is working).
>>>>>>>>>> It's
>>>>>>>>>> 96x96 pixels, and it's shipped with the application.
>>>>>>>>>>
>>>>>>>>>> When I launch the application, gdb says :
>>>>>>>>>> warning: Unable to read symbols for
>>>>>>>>>> "/Library/MobileSubstrate/MobileSubstrate.dylib" (file not found).
>>>>>>>>>> 2010-02-19 15:15:22.616 lightup[1275:207] MS:Notice: Installing:
>>>>>>>>>> com.me.lightup [lightup] (478.52)
>>>>>>>>>> And away we go...
>>>>>>>>>> libpng error: CgBI: unknown critical chunk
>>>>>>>>>> Terminal error invalid kind, File draw_object.cpp, line 1809
>>>>>>>>>>
>>>>>>>>>> And then the application crashes (the iPod return to springboard).
>>>>>>>>>>
>>>>>>>>>> I'm using hxcpp 2,05,1 ; neash 1,0,3 ; and nme 1,0,2.
>>>>>>>>>>
>>>>>>>>>> How can I load an image into my application then ?
>>>>>>>>>> Thanks.
>>>>>>>>>> Blue112.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> haXe - an open source web programming language
>>>>>>>>> http://haxe.org
>>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> haXe - an open source web programming language
>>>>>>>> http://haxe.org
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Tony Polinelli
>>>>>>> http://touchmypixel.com
>>>>>>>
>>>>>>> --
>>>>>>> haXe - an open source web programming language
>>>>>>> http://haxe.org
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> haXe - an open source web programming language
>>>>>> http://haxe.org
>>>>>
>>>>>
>>>>> --
>>>>> haXe - an open source web programming language
>>>>> http://haxe.org
>>>>>
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>
>>>
>>> --
>>> haXe - an open source web programming language
>>> http://haxe.org
>>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>

--
haXe - an open source web programming language
http://haxe.org