Hi,
I was also getting this error, but was able to resolve it. For me I
had two issues: the first was that there was XML header information
being passed from the server that I had to read first and then get the
binary data out of (I am using a web service). The second was the byte
data I was retrieving came in chunks and I wasn't merging them
together, so the file format was malformed. Maybe one of these are
your issue as well?

I'm not completely sure which of these bugs were causing the error,
but I know after fixing them the error was gone. Sorry I didn't pay
closer attention. Good luck...

On Oct 4, 2:08 am, Nemat <[EMAIL PROTECTED]> wrote:
> 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 android-developers@googlegroups.com
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