Obsolete
Status Update
Comments
sc...@gmail.com <sc...@gmail.com> #2
I just removed the whole crop part of the code and tried it and the image is still showing up in the camera's default folders (.thumbnails and Camera). So the problem exists in MediaStore.ACTION_IMAGE_CAPTURE itself. When MediaStore.EXTRA_OUTPUT is specified to store the image in a location on the sd card, the camera is still saving the same image to its default folders. How can this be avoided? Is there another extra parameter that can be specified for this intent so that this doesn't happen? If not, is there a way to get the uri's of the two image files so that I can delete them?
sc...@gmail.com <sc...@gmail.com> #3
Just to further explain what I'm trying to avoid...
After the ACTION_IMAGE_CAPTURE intent finishes I end up with the following 3 files on the sd card:
/myphotos/subject1_1313429919134.jpg
/dcim/.thumbnails/1313429928246.jpg
/dcim/Camera/2011-08-15_13-38-47_409.jpg
I would like to complete the intent with only the first file (/myphotos/subject1_1313429919134.jpg) being present. I had assumed that specifying EXTRA_OUTPUT would provide this result.
I event added the following line of code just prior to startActivityForResult(intent, TAKE_PHOTO) with no success:
intent.putExtra("return-data", false);
After the ACTION_IMAGE_CAPTURE intent finishes I end up with the following 3 files on the sd card:
/myphotos/subject1_1313429919134.jpg
/dcim/.thumbnails/1313429928246.jpg
/dcim/Camera/2011-08-15_13-38-47_409.jpg
I would like to complete the intent with only the first file (/myphotos/subject1_1313429919134.jpg) being present. I had assumed that specifying EXTRA_OUTPUT would provide this result.
I event added the following line of code just prior to startActivityForResult(intent, TAKE_PHOTO) with no success:
intent.putExtra("return-data", false);
ma...@gmail.com <ma...@gmail.com> #4
I see a lot of device duplicating image. Even though MediaStore.EXTRA_OUTPUT is specified pic is saved to default camera location as well. This becomes a real issue when sd card is full.
i....@gmail.com <i....@gmail.com> #5
I have an issue with some devices not providing the proper orientation of the image taken. See my post here; http://stackoverflow.com/questions/8450539/images-taken-with-action-image-capture-always-returns-1-for-exifinterface-tag-or
It seems like this issue is only happening on devices where this bug exists. The problem is that the file I specify is saved sideways (no rotation information) but the image saved in gallery is saved properly..
So i guess my question would be that if this bug is not going to be fixed, then is there a way to get the content uri of the image saved in gallery, if not is there a way to fix the bug so that proper image is saved in the proper place.
It seems like this issue is only happening on devices where this bug exists. The problem is that the file I specify is saved sideways (no rotation information) but the image saved in gallery is saved properly..
So i guess my question would be that if this bug is not going to be fixed, then is there a way to get the content uri of the image saved in gallery, if not is there a way to fix the bug so that proper image is saved in the proper place.
iv...@gmail.com <iv...@gmail.com> #6
I have the same problem on Samsung Galaxy S2. Saving images on both places and the image in URI specified by MediaStore.EXTRA_OUTPUT is saved sideways. Did you guys managed to solve this?
ma...@gmail.com <ma...@gmail.com> #7
I'm observing the same issue on an LG P350 and an HTC Flyer Tablet.
Why is it still in the "new" status? It has been confirmed by more than one user already.
Why is it still in the "new" status? It has been confirmed by more than one user already.
i....@gmail.com <i....@gmail.com> #8
I'm not sure.. When you google android orientation, it brings up alot of people complaining online, because they think it's the developer's fault. This should be looked at immediately but it doesn't seem to be getting any attention
sc...@gmail.com <sc...@gmail.com> #9
This problem still persists and I have confirmed it on both the Motorola Droid X and Droid X2 devices running Gingerbread version 4.5.605.MB810.Verizon.en.US . Not sure why this issue would still be marked New other than the Android team feels that it is a vendor specific problem that should be addressed by Motorola. I have very klugy code that I've written to deal with the image duplication, but it is very brittle. I'd prefer that Motorola dealt with this problem in a future OS release. They obviously know about the problem:
http://community.developer.motorola.com/t5/Android-App-Development-for/DROID-X-doesn-t-seem-to-respect-the-IS-PRIVATE-flag-when-taking/td-p/8890
i....@gmail.com <i....@gmail.com> #10
For people dealing with the orientation issue side effect of this bug, check out my rather reasonable solution to handle both cases (phones that have this bug and that doesn't have this bug); http://stackoverflow.com/a/8864367/137404
gl...@gmail.com <gl...@gmail.com> #11
I'm having the same problem with ACTION_VIDEO_CAPTURE. This unaccepted Stack Overflow answer (http://stackoverflow.com/a/4990769/403455 ) alleges that you must add the media to the MediaStore database beforehand. Another user states that this approach still didn't work.
gl...@gmail.com <gl...@gmail.com> #12
I filed a related issue for ACTION_VIDEO_CAPTURE:
http://code.google.com/p/android/issues/detail?id=37205
I attempted the aforementioned approach from the SO answer and it didn't work for me either.
It did do something; instead of just ignoring the `EXTRA_OUTPUT` parameter, like it normally does, it created a zero-length file with the (correct name) in the `/sdcard/video` folder despite that I specified a full path name like `/sdcard/some-existing-dir/newfile.3gp`.
My guess is we might see similar, if broken, behavior on ACTION_IMAGE_CAPTURE.
I attempted the aforementioned approach from the SO answer and it didn't work for me either.
It did do something; instead of just ignoring the `EXTRA_OUTPUT` parameter, like it normally does, it created a zero-length file with the (correct name) in the `/sdcard/video` folder despite that I specified a full path name like `/sdcard/some-existing-dir/newfile.3gp`.
My guess is we might see similar, if broken, behavior on ACTION_IMAGE_CAPTURE.
su...@gmail.com <su...@gmail.com> #13
Any luck on the aforementioned issue.. I am able to see duplicate images when trying to capture image with Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
su...@gmail.com <su...@gmail.com> #14
Hi, I m with this issue on my Galaxy SIII... I continue with the same problem... anybody get the solution?
lo...@gmail.com <lo...@gmail.com> #15
:-( no solution, just more developers complaining... i'm stuck for the third day on this issue on a Samsung Galaxy S2
en...@google.com <en...@google.com>
re...@gmail.com <re...@gmail.com> #16
Why this thread is Obsolete? This issue is still there. I am facing it on Moto G4 Plus. When we are calling an intent to perform some task and deliver the results back to us, I don't understand why it saves copy of a file in default Camera location too. I have gone through Stackoverflow threads and found a work around but why there is no clean way to do it?
st...@gmail.com <st...@gmail.com> #17
Yes, I can confirm that this issue is still with us. It seems like this behaviour is considered as a standard because I tried different vendors and in each case the image is being duplicated. I ended up with my own CameraActivity.
Description
private File photoFile;
private static final String newFolder = "/myphotos";
private OnClickListener photoButtonClickListener = new OnClickListener() {
public void onClick(View v) {
String fileName = "subject1" + "_" + System.currentTimeMillis() + ".jpg";
photoFile = new File(Environment.getExternalStorageDirectory() + newFolder, fileName);
//create new Intent
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
startActivityForResult(intent, TAKE_PHOTO);
}
};
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case TAKE_PHOTO: {
if (resultCode == RESULT_OK) {
doCropThing();
}
else if (resultCode == RESULT_CANCELED) {
}
break;
}
case CROP_PHOTO: {
if (resultCode == RESULT_OK) {
final Bitmap photo = data.getParcelableExtra("data");
// save photo to database here, then delete file
}
else if (resultCode == RESULT_CANCELED) {
}
break;
}
}
}
public void doCropThing() {
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(Uri.fromFile(photoFile), "image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
intent.putExtra("outputX", ICON_SIZE);
intent.putExtra("outputY", ICON_SIZE);
intent.putExtra("return-data", true);
startActivityForResult(intent, CROP_PHOTO);
}