Here's the situation.

Happens in ICS 4.0.2 on Galaxy Nexus; don't know about others. In
particular, this came up because my Verizon coverage is so deplorable
that a file transfer was incomplete.

Anyway, this jpg file has some bytes missing at the end. In windows,
you can see most of the file, and some gray stuff that shouldn't be
there in the lower right.

The Gallery on 4.0.2 will just come up with an empty black screen. On
a 3.2 tablet, it will come up black and toast that it failed to load.

Under these circumstances, I would expect
                Bitmap b =BitmapFactory.decodeByteArray(data, 0,
data.length,options);

to fail or return null. It does not. It returns a bitmap that appears
to be valid. In fact, you can query.

In that case, I would expect
                                        canvas.drawBitmap(bitmap, null, rect, 
paintT);
to fail or throw an exception.

It does not. It just doesn't draw anything, leaving a blank square in
that rectangle.

Therein lies the problem. I need to know if the bitmap is corrupt so I
don't keep trying to draw it. The fact that the bitmap is corrupt is
blindingly obvious to a human observer, but my app is oblivious to
that fact.

Can anyone add any insight?

Nathan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to