Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
BitmapFactory.decodeStream sometimes returns null
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
RoryD  
View profile  
 More options Oct 3 2009, 12:09 am
From: RoryD <rory1doug...@gmail.com>
Date: Fri, 2 Oct 2009 21:09:55 -0700 (PDT)
Local: Sat, Oct 3 2009 12:09 am
Subject: BitmapFactory.decodeStream sometimes returns null
I have an activity which performs an image search, the results (URLs
of thumbnails on the web) are rendered in a GridView.

My GridView adapter class delegates creating the actual Bitmaps to an
AsyncTask that loops to sequentially fetch the image content from each
URL using HTTPClient, and creates the Bitmaps using:

BitmapFactory.decodeStream(entity.getContent()).

I found that the above method sometimes returns "null" silently
instead of creating a Bitmap.   The occurrences appear to correlate
with larger stream sizes (I check this by logging
entity.getContentLength()).  However, if I put a breakpoint just prior
to the decodeStream call & then resume immediately every time I hit it
(i.e. pause briefly on each iteration), the Bitmaps are created
perfectly every time.

All the images are quite small (most <10K), so the download &
decodeStream happens fairly quickly.  There are never more than 10
images processed in one AsyncTask.

Any ideas on what's going wrong?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
anthony.dahanne  
View profile  
 More options Oct 14 2009, 8:10 pm
From: "anthony.dahanne" <anthony.daha...@gmail.com>
Date: Wed, 14 Oct 2009 17:10:47 -0700 (PDT)
Local: Wed, Oct 14 2009 8:10 pm
Subject: Re: BitmapFactory.decodeStream sometimes returns null
Hello !
I'm experiencing exactly the same problem (working every time while
debugging with breakpoints; sometimes failing while normally running),
on Android 1.5
Did you solve this problem ?
Anthony

On Oct 3, 6:09 am, RoryD <rory1doug...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
kevin.hooke  
View profile  
 More options Oct 20 2009, 11:44 am
From: "kevin.hooke" <kevin.ho...@gmail.com>
Date: Tue, 20 Oct 2009 08:44:51 -0700 (PDT)
Local: Tues, Oct 20 2009 11:44 am
Subject: Re: BitmapFactory.decodeStream sometimes returns null
I'm having a similar problem where BitmapFactory.decodeStream() is
working reliably in the emulator, but the same app transferred to the
phone is returning null everytime.

Any ideas?

Kevin Hooke

On Oct 14, 5:10 pm, "anthony.dahanne" <anthony.daha...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Streets Of Boston  
View profile  
 More options Oct 21 2009, 10:13 am
From: Streets Of Boston <flyingdutc...@gmail.com>
Date: Wed, 21 Oct 2009 07:13:04 -0700 (PDT)
Local: Wed, Oct 21 2009 10:13 am
Subject: Re: BitmapFactory.decodeStream sometimes returns null
Hi everyone,

Without (sample) code or a log-trace, there is not much that we can do
to help you.

On Oct 20, 11:44 am, "kevin.hooke" <kevin.ho...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom  
View profile  
 More options Oct 27 2009, 10:45 am
From: Tom <tomir...@googlemail.com>
Date: Tue, 27 Oct 2009 07:45:39 -0700 (PDT)
Local: Tues, Oct 27 2009 10:45 am
Subject: Re: BitmapFactory.decodeStream sometimes returns null
Hi,

I was having the same problem. It stoped when i gave the images i was
loading the header Content-Length.

Hope this helps.

On 21 Oct, 14:13, Streets Of Boston <flyingdutc...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nilesh  
View profile  
 More options Dec 16 2009, 12:46 am
From: Nilesh <anandparanil...@gmail.com>
Date: Tue, 15 Dec 2009 21:46:03 -0800 (PST)
Local: Wed, Dec 16 2009 12:46 am
Subject: Re: BitmapFactory.decodeStream sometimes returns null
BitmapFactory.decodeStream sometimes returns null

Try new BufferedHttpEntity (entity);
before calling getContent()

On Oct 27, 7:45 pm, Tom <tomir...@googlemail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »