Android Camera PictureCallback data seems corrupted on HTC Desire S
<p>I'm using PictureCallback to capture an image. And its working fine. But In HTC Desire S its not returning proper data. It returns a corrupted image like the following one</p>

<p><img src="http://i.stack.imgur.com/XPGhh.jpg" alt="enter image description here"></p>

<p>Here is the code that i used</p>

<pre><code>    PictureCallback cameraPictureCallbackJpeg = new PictureCallback() {
            @Override
            public void onPictureTaken(byte[] data, Camera camera) {

                          FileOutputStream outStream = null;
                  try {
                // write to local sandbox file system
                // outStream =
                // CameraDemo.this.openFileOutput(String.format("%d.jpg",
                // System.currentTimeMillis()), 0);
                // Or write to sdcard
                outStream = new FileOutputStream(String.format(
                        "/sdcard/%d.jpg", System.currentTimeMillis()));
                outStream.write(data);
                outStream.close();
                Log.e("error", "onPictureTaken - wrote bytes: " + data.length);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
            }
    }
</code></pre>

<p>I must tell you that I've used other methods to convert the data into a bitmap. Thanks in advance. I'm stuck here. Any help will be appreciated. </p>
