1

Possible duplicate this question: Samsung galaxy S4 image capture Issue but I can't find the right answer for my case.
I try to save byte[] data images from onPictureTaken and got the problem when saving image to sdcard like this:

enter image description here

As you can see, the image contain two line gray areas. But it only occurred on galaxy s4 device and only for my app. Other devices (test on galaxy s3, note 3, galaxy ace) and other camera app (both default camera and third party camera apps) in S4 are OK. I don't know where my problem is. Here is my try:

File file = new File(fileName);
    FileOutputStream fos;
    BufferedOutputStream bos = null;
    try {
        final int bufferSize = 1024 * 4;
        fos = new FileOutputStream(file);
        bos = new BufferedOutputStream(fos, bufferSize);
        bos.write(bitmapData);
        bos.flush();
    } catch (Exception ex) {
        throw ex;
    } finally {
        if (bos != null) {
            bos.close();
        }
    }

Please tell me where am I wrong. Thanks

Community
  • 1
  • 1
ductran
  • 10,043
  • 19
  • 82
  • 165
  • please visit http://stackoverflow.com/questions/17141621/samsung-galaxy-s4-image-gets-corrupted-while-taking-from-camera is it helpful to you!! – Jitesh Upadhyay Feb 21 '14 at 05:50

0 Answers0