Problem in crop image with android version 2.1

All your problems with Audio, Video and Images.

Problem in crop image with android version 2.1

Postby pandey_adarsh147 » Fri Feb 12, 2010 1:41 pm

Hi all,

I m facing problem in crop image Activity. It give error when I pass the image uri to the cropimage activity :

02-12 13:02:32.689: ERROR/AndroidRuntime(374): Uncaught handler: thread main exiting due to uncaught exception
02-12 13:02:32.699: ERROR/AndroidRuntime(374): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://media/external/images/media/12 }} to activity {com.abc/com.abc.CameraActivity}: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.EDIT dat=content://media/external/images/media/12 cmp=com.android.camera/.CropImage (has extras) } from ProcessRecord{43b72040 374:com.abc/10028} (pid=374, uid=10028) requires null
02-12 13:02:32.699: ERROR/AndroidRuntime(374): at android.app.ActivityThread.deliverResults(ActivityThread.java:3314)
02-12 13:02:32.699: ERROR/AndroidRuntime(374): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3356)


Here is our code:
Intent i = new Intent("com.android.camera.action.CROP");
i.setClassName("com.android.camera",
"com.android.camera.CropImage");

if (data != null && data.getData() != null) {
i.setData(data.getData());
userImageUri = data.getData();
} else {
i.setData(userImageUri);
}

i.putExtra("noFaceDetection", false);
i.putExtra("outputX", CommonConstant.ICON_WIDTH);
i.putExtra("outputY", CommonConstant.ICON_HEIGHT);
i.putExtra("aspectX", CommonConstant.ASPECT_X);
i.putExtra("aspectY", CommonConstant.ASPECT_Y);
i.putExtra("scale", true);

ContentValues values = new ContentValues();
values.put(Media.TITLE, "User_t" + "_Image");
values.put(Media.BUCKET_ID, "User-T");
values.put(Media.BUCKET_DISPLAY_NAME, "image_t");
values.put(Media.IS_PRIVATE, 1);
userThumbnailUri = getContentResolver().insert(
Media.EXTERNAL_CONTENT_URI, values);
i.putExtra(MediaStore.EXTRA_OUTPUT, userThumbnailUri);
try {
startActivityForResult(i, CROP_IMAGE);

} catch (Exception e) {
Log.d("CROP ERROR", "Croping ERROR"+e.getMessage()+e);
}


And URI comes from following activity

intent = new Intent("android.intent.action.GET_CONTENT");
intent.setType("image/*");

startActivityForResult(intent, Get_IMAGE);


data.getData() gives result to crop image activity

Also this things work in android 1.6 but not in 2.1
pandey_adarsh147
Freshman
Freshman
 
Posts: 4
Joined: Fri Jan 15, 2010 2:20 pm

Top

Postby pandey_adarsh147 » Sat Feb 13, 2010 2:14 pm

Please reply, I have got some permission error, but I have tried all permission with no luck
pandey_adarsh147
Freshman
Freshman
 
Posts: 4
Joined: Fri Jan 15, 2010 2:20 pm

Postby pandey_adarsh147 » Thu Feb 18, 2010 6:31 am

any buddy please reply
pandey_adarsh147
Freshman
Freshman
 
Posts: 4
Joined: Fri Jan 15, 2010 2:20 pm

Postby sarangkulkarni17 » Fri Mar 12, 2010 1:07 pm

pandey_adarsh147 wrote:any buddy please reply


Hello +-,

I am also facing the same problem with emulator 2.0.1
It works fine with 1.6

i found this link
http://code.google.com/p/android/issues/detail?id=6662

is any other way to fix this?

Please help us
sarangkulkarni17
Developer
Developer
 
Posts: 29
Joined: Fri Feb 13, 2009 10:00 am
Location: Pune

Postby pandey_adarsh147 » Mon Mar 22, 2010 9:55 am

Problem has been solved, actually crop image activity worked with action name, but camera activity save image with wrong permission. thats why crop image was not working for my case.

Thanks
pandey_adarsh147
Freshman
Freshman
 
Posts: 4
Joined: Fri Jan 15, 2010 2:20 pm

Postby vik » Wed Mar 24, 2010 11:43 am

hey can please put that specific code in here .. as i am also having the same problem with 2.x . m able to crop it for gallery images but not for image :cry: :cry:
User avatar
vik
Senior Developer
Senior Developer
 
Posts: 141
Joined: Wed Sep 09, 2009 7:32 am

Top

Camera Application

Postby naveen » Sat Mar 27, 2010 11:00 am

Hi pandey_adarsh147,

I am also new to android development.
By reading your posts it seems as if u r working on camera application development in android.
Great! I am also working on camera application development.

So can u please upload or suggest me some good readings for learning how to make a camera application.

Sorry that i posted this query under this topic! :)
naveen
Developer
Developer
 
Posts: 43
Joined: Fri Mar 26, 2010 10:06 am

Camera Application

Postby naveen » Sat Mar 27, 2010 11:03 am

Hi..
This is my first stint with Mobile application development.

Its been just a month that i started studying Android and application development.

So please revert back with some basic + Advanced reading stuff on android that will help me understand Camera Application development in android better.

Thanks! :D
naveen
Developer
Developer
 
Posts: 43
Joined: Fri Mar 26, 2010 10:06 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 23 guests