3

FYI This is not a ratio issue.

I have an application with a custom camera that for all intents and purposes works fine except in the following scenario.

I tap the button to take a picture. Immediately afterward i move the camera. The preview displays the correct image. The image saved to disk is a split second after that when the camera is moving away.. and is blurred.

The button tap calls takePicture(null, null, this);

The listener:

public void onPictureTaken(byte[] data, Camera camera) {
    File pictureFileDir = getTempDir(activity);


    //Build FileName
    ...
    String filenameOfOriginal = filename + "-original" + "." + suffix;

    File originalPictureFile = new File(filenameOfOriginal);
    try {
        FileUtils.writeByteArrayToFile(originalPictureFile, data);
        Dbg.logD(TAG, "New Image saved:" + filenameOfOriginal);

    } catch (IOException error) {
        Dbg.logD(TAG, "File" + filenameOfModified + " not saved: " + error.getMessage(), error);
        error.printStackTrace();
    }
    ...
}

Any ideas?

BBaker
  • 156
  • 1
  • 7
  • 1
    Take a look at this question http://stackoverflow.com/questions/26318300/samsung-galaxy-s5-camera-flash-problems – Olumide Jan 14 '15 at 03:52
  • @Olumide Thanks for your reply! That looks like the problem or at least part of it. I am using an sg5 and nexus 5. I added the hidden parameter to my camera for the sg5 and it introduced a whole bunch of other problems but the disparity is gone... – BBaker Jan 14 '15 at 17:49
  • Hello, could you please describe the side effects of adding the hidden parameter? I don't own a SGS5, but some users reported a similar problem. So before I apply this solution I would like to know what are the new problems coming from it. Thank you – PerracoLabs Jul 05 '15 at 20:26
  • This was a while ago so assume my answer is incomplete.. however i do remember it affecting the preview screen.. the preview screen wouldn't automatically pause upon picture taken and display the photo. I had to switch the screen to an imageview displaying the taken image programatically.. after lookinh at other custom camera code it seem everyone was already doing that. hope that helps – BBaker Jul 06 '15 at 20:58

0 Answers0