Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Contributor
t_rich
Posts: 8
Registered: ‎06-23-2012
My Device: PlayBook
My Carrier: All
Accepted Solution

App crashing when loading very large images into Spark Image component

Hi everybody,

 

A customer of ours needs to display very large jpgs (about 8000 x 5000 px), that are scrolled and zoomed using touch gestures.

 

To my very surprise, the performance doing this using a scroller is quite nice :smileyhappy:

 

BUT unfortunately the app crashes sometimes when loading the picture. (about 15% chance of doing so)

 

Debugger gives no infos at all, simply quits debugging.

 

Does anybody have an idea what might be causing this or how to avoid this?

 

P.S. tested this on several machines and different TabletOS Versions, incl. 2.1.0.1032

 

Many thx,

 

Tim.

 

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: App crashing when loading very large images into Spark Image component

Could be a memory issue. Try profiling the app before the image is loaded. You also might want to consider breaking the image up into tiles. Therefore you can load only what is visible and have better download performance.
Please use plain text.
New Contributor
t_rich
Posts: 8
Registered: ‎06-23-2012
My Device: PlayBook
My Carrier: All

Re: App crashing when loading very large images into Spark Image component

Wow, incredible, how fast this forum is, thanks for that. :smileyhappy:

 

Thought about the tile idea as well, but did not do this up to several reasons:

- The file is not loaded from a remote server but from local store, thus loaded in a few ms.

- The view defaults to a "totale", zooming just far enough out, so that all tiles would be visible at the same time.

 

BTW: Does anybody know a component htat will do this out of the box? Seemed to me a little too much work just to try and see,,,

 

I'll try profiling, though, and post the results later.

 

thx again,

 

Tim

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: App crashing when loading very large images into Spark Image component

I have had misterouus crashes with "large" images that seem fairly random. The app just closes with no exceptions thrown in the debugger. My images are not as large as yours, but I might load a bunch, so that is why I believe it to be a memory issue.
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: App crashing when loading very large images into Spark Image component

If the image is installed with the app, you would need to tile it before hand. You can tile an image in ActionScript if you need to on first use as well (and then store the tiles).
Please use plain text.
New Contributor
t_rich
Posts: 8
Registered: ‎06-23-2012
My Device: PlayBook
My Carrier: All

Re: App crashing when loading very large images into Spark Image component

Sorry it took me to long to respond, but I had other issues to be dealt with first :smileywink:

 

Using the Profiler showed up a memory leak in the image's viewer skin.

So it was a memory issue.

 

I has to set BimapImage's source value to null before destroying the view manually, although I had no other references to it.

Somewhat strange, but doing this fixed my problem.

It could reappear obviously using a single even larger image, but I guess one has to accept  some limitations on a mobile device in some way. :smileywink:

 

Please use plain text.