All properties of intent.putExtra to crop image in android - android

I'm creating an app where the user will use the camera or choose some photos from the gallery.
I'm trying to put some rules when the user chooses the photo from the album but I don't know all the properties and I tried to search some site or tutorial but I didn't found anything.
Someone knows where I can find this or learn the properties.
Properties like this
intent.putExtra("crop","true");
intent.putExtra("aspectX",10);
intent.putExtra("aspectY",10);
intent.putExtra("outputX",256);
intent.putExtra("outputY",256);
intent.putExtra("return-data",true);
I need to disable the resize function from the crop screen and I want to learn more about working with an android camera.
Thanks and regards to everyone.

"return-data"
"cropped-rect"
"aspectX"
"aspectY"
"spotlightX"
"spotlightY"
"outputX"
"outputY"
"scale"
"data"
"scaleUIfNeeded"
"outputFormat"
"set-as-wallpaper"
"noFaceDetection"

I refer you to Mr. Murphy's post here: http://commonsware.com/blog/2013/01/23/no-android-does-not-have-crop-intent.html

Related

com.android.camera.action.CROP in objective-c?

I've been created an app on android and I'm using the com.android.camera.action.CROP intent to crop picture (the user can select the crop area).
I'm searching an easy way to do the same with objective-c as android could. I found some solution but it's only to crop with fixed parameter.
Do you have idea (github link, blog link...)?
Thanks in advance
if you want to use the third party libraries than here are the link,
pecropViewController
RSKImageCropper
or if you want to use inbuilt cropper of ios than when you create imagepicker controller object set it's property like this
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:picker animated:YES completion:NULL];
here picker.allowsEditing is the property which allow to crop image in square.
Hope, this will help you
There are so many good example available for crop image with Objective-C.
Please check few examples list as below.
PEPhotoCropEditor
TOCropViewController
BABCropperView
PhotoTweaks
MDImageCroper
InstagramPhotoPicker
RSKImageCropper
CropperView
VPImageCropper
PerfectImageCropper

Get Owner Profile Image Flikr API

I am using flickr API in my project, everything is working fine but i stuck at point where I am not able to get user's profile picture.
For example i am getting below type response
<user nsid="12037949754#N01" url="http://www.flickr.com/people/bees/" />
But not getting user image URL , can any one please help me out?
It's really very simple to find out the profile picture of any user which is called buddyicons. The API format/syntax is:
http://farm{icon-farm}.staticflickr.com/{icon-server}/buddyicons/{nsid}.jpg
For example: http://farm9.staticflickr.com/8573/buddyicons/116479554#N04.jpg
Here in this example, icon-farm=9, icon-server=8573 and nsid=116479554#N04
By default, the above example will give you default image of size 48*48(Each user has this size image may or may not exist large, medium images), but if you want large, medium, small profile pictures then just append _l, _m, and _s at the end of nsid respectively.
For example: http://farm9.staticflickr.com/8573/buddyicons/116479554#N04_l.jpg
Hope this help you and resolve your issue and might be useful to other users also who face the same issue.

Android Photo Viewer Demo

I've been trying to figure out how to display a photo on Android. I can create an ImageView and display a picture, but the functionality is limited (no zoom, pan or share). Is there a demo or tutorial with code out there on how to do this? I've been searching all week with no luck.
Thanks.
P.S.> Please No Snark!
Maybe I don't understand how to create a uri correctly or how to make my resource available to the viewer. I have a resource ID, R.drawable.opal, I'm using to display different minerals and gems for a science project. If the student clicks the small sample photo, then I want to bring up a bigger and better viewer for the photo to allow them to compare to their collected rock.
Unless you really need to build your own you should probably just use the gallery's viewer. Send it the picture by using the view intent like so:
Intent viewImageIntent = new Intent(android.content.Intent.ACTION_VIEW, uri);
startActivity(viewImageIntent);
Replace "uri" with the image's uri of course. Writing your own viewer is really involved and would include threading, physics calculations and handling touch inputs.

How do I retrieve a user's Facebook avatar in my Android App?

I'm trying to retrieve the currently-logged-in user's avatar image so that I can save it on my server and use it later in my application.
How would I go about getting the image directly?
Try this:
(replace USER_ID with alias or user ID...)
set source as https://graph.facebook.com/USER_ID/picture
for example large icon of a Page ID 149926629437 is:
http://graph.facebook.com/149926629437/picture?type=large
<img src="http://graph.facebook.com/149926629437/picture?type=large"/>
more info (specify size etc...):
http://developers.facebook.com/docs/reference/api/
part Pictures
(I also userd the aQuery (android query) to cache images...
aq.id( holder.image).image("https://graph.facebook.com/" + USER_ID + "/picture?type=normal");
http://code.google.com/p/android-query/
It seems working fine...
)
Can't say much about this, but you might want to try the facebook android sdk here ->https://github.com/facebook/facebook-android-sdk . Good luck :)
If you want a higher quality profile picture try:
https://graph.facebook.com/{ID}?fields=picture.height(2048)
And then retrieve the response.picture.data.url

Android ImageViewer class supporting Pinch-Zoom and Scrolling

I am searching an ImageViewer library that opens an image in my application for a given URI (the image fetched by a webservice is already stored within my application in a secured place). I really like the "Samsung Galaxy S" ImageViewer-Activity because it uses pinch-zoom and "scrolling" vertical/horizontal. Also it scales the picture very fast on my samsung phone :)
I know that I can open an image with an intent like this:
Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(uri, "image/*");
startActivity(i);
The best suitable viewer is being called, when none is found an ActivityNotFoundException is raised. So thats cool!
But the problem is that I am not allowed to open an image with an external intent (for security purposes). i.e: The user should not have the posibility to save the opened image via a menu option to his external sd-card or send this picture to another service (email/twitter or s.o.). So I have to write my own ImageViewer-Class (Activity) that can only be called within my application...
Unfortunately I am not very skilled transforming images, so is there any open source project (or library) that covers this use case?
I already asked google and found this one http://code.google.com/p/android-pinch/ but it didnt work very well (also it has no scroll-functionality).
Thanks for your tips :)
At this moment I'm too use WebView. But this is conceptually wrong, WebView is not for displaying images, it for displaying web content. WebView is bulky and cumbersome. You restricted in customizing it. For example, I need scaling, but I don't want to see zoom controls, or I want to move them in other place then default.
Therefore, I searched about this problem and found some solutions:
PhotoView widget from Chris Banes
Also, you can look at this tutorial from Sony Ericsson (sources available) and can implement your own widget: part1, part2, part3
And another one library ImageViewZoom at github
UPDATE
Chris Banes was created awesome library which supports gestures for zooming pictures, see first point above
The easiest way to handle images is using a WebView, if the image is stored local or somewhere online. WebView supports pinch to zoom and other functions.
Example Java:
String imageUrl = "file:///local/dir/image.jpg"; // http://example.com/image.jpg
WebView wv = (WebView) findViewById(R.id.yourwebview);
wv.getSettings().setBuiltInZoomControls(true);
wv.loadUrl(imageUrl);
XML source:
<WebView android:id="#+id/yourwebview"
android:layout_width="match_parent"
android:layout_height="match_parent" />

Categories

Resources