question

dalvin16 avatar image
dalvin16 asked

Picture is getting cut off on the left and right edge.

We have an app where we click the image of an object and show that to the user. The code is working fine on all other android tablets but on Kindle Fire the image of the object gets cropped on the left and right. Following is our code to capture image. if (RdcActivityCamera.this.canAutoFocus()) { mCamera.autoFocus(new AutoFocusCallback() { @Override public void onAutoFocus(boolean success, Camera camera) { if (success) { mCamera.takePicture(mShutterCallback, null, null, mPictureCallbackJpeg); } } }); } else { mCamera.takePicture(mShutterCallback, null, null, mPictureCallbackJpeg); } private PictureCallback mPictureCallbackJpeg = new PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { Log.v(RdcConstants.LOG_TAG, "RdcActivityCamera : mPictureCallbackJpeg : START"); Log.v(RdcConstants.LOG_TAG, "Jpeg Data size = " + data.length); Intent intent = new Intent(); if (data.length > 0) { RdcShareObject.getInstance().setBytes(data); intent.putExtra(RdcConstants.INTENT_EXTRA_PICTURE_BYTE_DATA, true); intent.putExtra(RdcConstants.INTENT_EXTRA_PICTURE_ROTATION, mRdcViewCameraPreview.getCameraRotation()); } else { RdcShareObject.getInstance().setBytes(null); intent.putExtra(RdcConstants.INTENT_EXTRA_PICTURE_BYTE_DATA, false); intent.putExtra(RdcConstants.INTENT_EXTRA_PICTURE_ROTATION, mRdcViewCameraPreview.getCameraRotation()); } setResult(Activity.RESULT_OK, intent); finish(); Log.v(RdcConstants.LOG_TAG, "RdcActivityCamera : mPictureCallbackJpeg : END"); } }; Then we decode the bytes into bitmap and show it in image, Preview of the object in surface view looks fine. I have dumped the bytes into a file and then opened that file into computer that is also cropped off.
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
We have hosted few sample apps to demonstrate best practices for Kindle tablets here : https://developer.amazon.com/public/solutions/devices/kindle-fire/app-devel... Please find Sample Camera app there to understand what is best practice to capture an image using Camera in Kindle Fire tablet. Please get back if this does not solve your issue. Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dalvin16 avatar image
dalvin16 answered
It's a broken link, It's now showing any sample apps.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.