1

I want to take a photo with an Intent on android.provider.MediaStore.ACTION_IMAGE_CAPTURE,

next crop the result with:

Intent intent = new Intent("com.android.camera.action.CROP");
intent.setClassName("com.android.camera", "com.android.camera.CropImage");

I follow the sugestions made at: Android: Crop an Image after Taking it With Camera with a Fixed Aspect Ratio

However when calling the crop activity I get (already checked the LogCat output) a permission error, saying something like:

Permission denial on a Intent to access the temporary image created by the camera activity on my SDcard.

Can you please suggest a solution for Android 2.2 ?

Thank you

Community
  • 1
  • 1
CGM
  • 11
  • 1
  • 2

2 Answers2

0

CGM,

DO you have

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

In your AndroidManifest.xml?

It would be required to modify something on the SD Card.

Will Tate
  • 33,439
  • 9
  • 77
  • 71
  • Hi Willytale, I have the following permissions set in the AndroidManifest.xml: – CGM Feb 09 '11 at 16:05
  • Hmm, based on your description you shouldn't need any others. Could you post the exact error from logcat? – Will Tate Feb 09 '11 at 16:10
  • Permission Denial: starting Intent {act=com.android.camera.action.CROP dat=file///sdcard/tmp_contact_1297269884838.jpg...} – CGM Feb 09 '11 at 16:49
  • It seems the crop intent was actually removed from froyo. See: http://groups.google.com/group/android-developers/browse_thread/thread/2dd647523926192c/167af114c229c489?lnk=raot – Will Tate Feb 09 '11 at 17:14
-1

Searching the SDK finds no mention of "com.android.camera.action.CROP". As such it is an undocumented implementation detail of the system and, if not broken already, is likely to break in the future.

willytate posted this informative link in the comments. I'll repost: http://groups.google.com/group/android-developers/browse_thread/thread/2dd647523926192c/167af114c229c489?lnk=raot&pli=1

Dianne Hackborn is the authority on the matter.

Danny Armstrong
  • 1,320
  • 12
  • 13