Giter VIP home page Giter VIP logo

android-crop's People

Contributors

ahmadshahriari avatar alexblack avatar antonio-manuel avatar bod avatar chrislacy avatar clemp6r avatar daisy1754 avatar deronbrown avatar dlackty avatar folivares avatar h46incon avatar jdamcd avatar josephleon90 avatar kamiox avatar kriztan avatar mcginty avatar mibrahim017 avatar nostra13 avatar sergii-frost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-crop's Issues

CropActivity empty on Samsung device

Hi,
Your Library works perfectly with all device, except Samsung device (I tried on S2 and Note 2). That's really urgent, may be you have some workaround, I can not find where does the problem?
sc20140711-120218

Thanks for your job

Multitouch scaling

Using multitouch to scale the crop region seems to produce some odd results, is that because multitouch isn't really supported? Or am I just using it wrong?

OutOfMemoryError when reading picture.

Thanks jdamcd for the source.
there is an issue like the followed:
After choose picture, this happened in reading picture at CropImageActivity at line number : 135. the code is
rotateBitmap = new RotateBitmap(BitmapFactory.decodeStream(is, null, option), exifRotation);

Crop Image Disappearing on Orientation Change

As said in title, when a user flips the orientation of their device, the image is not loaded. When "done" is pressed, no usable information returned.

Using this call from an Activity:
new Crop(selectedImageUri).output(croppedFileUri).withAspect(width, height).withMaxSize(width, height).start(this);

Exif Orientation data is not copied if you use the same Uri for both Input and Output

This was tested on a 2.3.3 device; easy work around is to simply make sure the output URI is different from the input URI but may be causing issues related to #46.

Relevant code is
(https://github.com/brandon515/android-crop/blob/aa6023d8cb276805ec883f3eecaec4c4949007a6/lib/src/main/java/com/soundcloud/android/crop/CropImageActivity.java#L407):

       try {
            outputStream = getContentResolver().openOutputStream(saveUri);
            if (outputStream != null) {
                croppedImage.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
            }
        } catch (IOException e) {
            setResultException(e);
            Log.e("Cannot open file: " + saveUri, e);
        } finally {
            CropUtil.closeSilently(outputStream);
        }

        if (!IN_MEMORY_CROP) {
            // In-memory crop negates the rotation
            CropUtil.copyExifRotation(
                    CropUtil.getFromMediaUri(getContentResolver(), sourceUri),
                    CropUtil.getFromMediaUri(getContentResolver(), saveUri)
            );
        }
  1. Output Uri gets written to by the bitmap (which is also input)
  2. Exif orientations get copied from input to output
  3. Exif data is lost as the bitmap has already overwritten it leaving the image with no Exif data so it's not possible to orientate the image correctly.

I'd do the fix myself but really need an IDE for this fix and it doesn't appear to be easily importable into Eclipse (I ain't savvy with Gradle and Android Dev Tools)

Doesn't respect the original orientation

If the original picture is taken with a camera orientation different from default, the cropped photo is rotated (as far as I can tell, the rotation is the negative rotation of the original). I guess the EXIF info is removed or somehow messed up.

I've tested on multiple devices and it's consistent.

I'm starting to do some debugging in the source code, but I would appreciate any help understanding the logic. Thanks.

Removing scaling

Hi,

Is there any option to remove the scaling of the box ?

Ultimetely, I want to make it scale only when i drag it from corners.

Not compiling.

Importing the .zip 2 projects in Eclipse is a mess.
They have no target APIs, the lib is not a lib project, there are no source files, etc.

It is just built for Gradle?

IllegalArgumentException: Unknown column requested: _data

In Google Play I have the following stack trace

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.krittiq.app/com.soundcloud.android.crop.CropImageActivity}: java.lang.IllegalArgumentException: Unknown column requested: _data
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: Unknown column requested: _data
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:167)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
at android.content.ContentProviderProxy.query(ContentProviderNative.java:413)
at android.content.ContentResolver.query(ContentResolver.java:461)
at android.content.ContentResolver.query(ContentResolver.java:404)
at com.soundcloud.android.crop.CropUtil.getFromMediaUri(CropUtil.java:95)
at com.soundcloud.android.crop.CropImageActivity.setupFromIntent(CropImageActivity.java:126)
at com.soundcloud.android.crop.CropImageActivity.onCreate(CropImageActivity.java:79)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
... 12 more

Device: n7000 (Android 4.4)

Add support for compat library fragments.

I currently develop an app for Android 4+.
However, because that app is using nested fragments (4.1+) I had to use the compatiblity library.

I badly need a start method that would work with the support Fragment class.

Add support for Storage Access Framework

I seem to be having permission problems pulling images from the "Recent" images, with it complaining about android.permission.MANAGE_DOCUMENTS missing, even though I have it declared.

Try croping taked photo

Hi,
I try to crop a taken photo but doesn't work.

Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(intent, 1);
.....
onActivityResult

Uri inputUri = data.getData();
Uri outputUri = Uri.fromFile(new File(getCacheDir(), "cropped"));
new Crop(inputUri).output(outputUri).asSquare().start(this);

The image is not loaded, why?

Thanks

Image cropped is rotated.

Hi !

I found your lib and it's a very good work. Thank you very much.

However, i have a little problem. When my image is cropped, result picture is rotated (90 on the right).

Is a known issue or it's just me ?

Thx :p

Input lost on screen orientation changed

There is an issue with the library that if the user gets to the cropping screen, and flips his device - the received image clears and the user can't crop it.

Is it possible to default the crop to the entire image?

When I fire up the crop activity, the initial crop area is square and typically smaller than the image. For my use cases its most common to do no cropping, so I'm thinking if the crop area was the full image to start then that would work best for users.

I'm invoking it like this:

Uri outputUri = Uri.fromFile(new File(Constant.SD_PICTURE_FOLDER, Constant.LOGO_NAME));
new Crop(source).output(outputUri).start(activity);

Ability to scale not apparent.

It's not completely obvious that you can in fact scale the image. It took me several minutes before I realized I had to drag on the edges. I may just be an idiot but perhaps including the blue dots at all times or for a few seconds when the activity first launches would better suggest that to the user.

Current .start(Activity activity) functionality is limiting.

Only allowing the crop activity to be started via an activity is a bit restrictive, I'm trying to deliver my result to a fragment's onActivityResult instead of an activity and also add some extras to the intent that is returned. I know this is vague but some more control over launching the activity/returning a result would be very helpful.

Enhancement: Handles should initially be visible

The little circle "handles" on the crop box should start out visible, rather than requiring the user to drag the side before becoming visible.

This would let the user know that the box is resizable, and not just movable.

withMaxSize(x,y) not working

First, thank you for your perfect code : )
I want to crop image to 300*300 on android 4.1.2 , and my code like this:
new Crop(inputUri).output(outputUri).withMaxSize(300, 300).asSquare().start(mActivity);
But I found it does not work.
So I rewrite some code in the library's source code.

In line:339
croppedImage = decoder.decodeRegion(rect, new BitmapFactory.Options());
changed to
Options options = new BitmapFactory.Options();
options.inSampleSize = width / maxX;
if(options.inSampleSize <= 0) {
options.inSampleSize = 1;
}
croppedImage = decoder.decodeRegion(rect, options);

Finally, thanks again.

Cropped area is not transparent

Cropped area should be differ from non-cropped area like this
Screenshot

but it's darkened as outer area.
Android 4.2.2.
What's the problem can be?

How to pass an ID completely through CropImageActivity?

I have an image that I need cropped. However, it has and ID or Tag associated with it. How can I open the CropImageActivity and pass it the ID and then in the callback in the main Activity access that ID?

I tried playing around with the Extras, but gave up after a while. Am I missing something basic about Android? I understand how to pass and receive objects vi an Intent but can we also "pass through"?

Also while trying to start the crop activity manually instead of by new Crop(sourceUri), I ran into problems because the Interface Crop. Extra is not public. Can that be made public?

KitKat Issue

I am cropping the gallery image and getting this error-

java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/image%3A29879 from pid=23358, uid=10203 requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission().

Get the picture quality is poor。

First,this issue still exists it seems
#27
so,I made the following changes in CropImageActivity.java:

  1. IN_MEMORY_CROP = Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD_MR1;
    not '<'.
    2.// RectF dstRect = new RectF(0, 0, width, height);
    RectF dstRect = new RectF(0, 0, outWidth, outHeight);
    If a high-resolution picture itself,and of high quality(maybe 4~5M),After cutting,get the picture quality is poor.

Bitmap was larger

when i want to cut a larger picture,sometimes will be crashes and move highlightView to slow. So i think we import picture when we need to compress.
setupFromIntent

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.