Hi,
I m also getting this error........
What is the reason behind.My code is:
public Bitmap getFromServer(String url)
{
Bitmap bitmap = null;
InputStream in = null;
OutputStream out = null;
int IO_BUFFER_SIZE=1*1024*1024;
ImageView i = new ImageView(this);
try {
in = new BufferedInputStream(new
URL(url).openStream(),IO_BUFFER_SIZE);
final ByteArrayOutputStream dataStream = new
ByteArrayOutputStream();
out = new BufferedOutputStream(dataStream, 4 * 1024);
copy(in, out);
out.flush();
final byte[] data = dataStream.toByteArray();
bitmap = BitmapFactory.decodeByteArray(data, 0,
data.length);
// i.setImageBitmap(bitmap);
} catch (IOException e) {
android.util.Log.e("IO", "Could not load buddy icon: "
+ this, e);
} finally {
closeStream(in);
closeStream(out);
}
return bitmap;
}
private static void copy(InputStream in, OutputStream out) throws
IOException {
byte[] b = new byte[4 * 1024];
int read;
while ((read = in.read(b)) != -1) {
out.write(b, 0, read);
}
}
/**
* Closes the specified stream.
*
* @param stream The stream to close.
*/
private static void closeStream(Closeable stream) {
if (stream != null) {
try {
stream.close();
} catch (IOException e) {
android.util.Log.e("IO", "Could not close stream",
e);
}
}
}
On Oct 4, 3:35 am, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> Could you attach a test image and the code that you are using to load this
> image?
>
> 2008/10/3 tberthel <[EMAIL PROTECTED]>
>
>
>
> > I get the following error loading some images that loaded in .9 Beta:
>
> > D/skia ( 226): xxxxxxxxxxx jpeg error 53 Not a JPEG file: starts
> > with 0x%02x 0x%02x
>
> > Is this a bug or something that will stay in the next release?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---