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

Java Development

Reply
Developer
robbatt
Posts: 21
Registered: ‎11-09-2009
My Device: Not Specified
Accepted Solution

PNGEncodedImage.getBitmapImpl() -> IllegalArgumentException

Hi guys,

 

i am currently doing some bulk downloads of small .png files. The filepaths are parsed from an xml file, then downloaded, then passed to Bitmap.createBitmapFromPNG() as a Byte array.

 

The Bitmaps are created perfectly one after another, the function passing the paths is synchronized, no problems so far. just when I pass files of about 50Kb, (haven't tried bigger ones) it throws the IllegalArgumentException.

 

Any clue?

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: PNGEncodedImage.getBitmapImpl() -> IllegalArgumentException

I would immediately suspect some corruption in the transfer.  Take a really small file, send it down, dump out the bytes that you get to make sure that they really are the same as you expect  from the same dump on the Server.

 

One perhaps easier option is to do this and save onto SD Card, then use PC software to do the compare.

Please use plain text.
Developer
robbatt
Posts: 21
Registered: ‎11-09-2009
My Device: Not Specified

Re: PNGEncodedImage.getBitmapImpl() -> IllegalArgumentException

Thanks Peter,

 

it was the DownloadCombiner routine from the KB that failed, the file did not seem to have a size defined so the DC kept downloading until a timeout. In this case I just cancel the routine after a few runs. If the file cannot be opened afterwards I delete it and skip it. Else the file is perfect, size as expected, can be used normal.

Please use plain text.