Yalantis / uCrop

Image Cropping Library for Android

Home Page:https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cropping options

canberkcakmak opened this issue · comments

How can i disable only original cropping with options. using?

Currently you cannot do this. However I'm planning to add a feature so you can set your own selection of aspect ratio buttons in future update.

This is great. Thanks for answering. This is important because i have a project about photography and i think some users want to upload width :30px height:5000px photos for crashing to my app :). Have a nice day

@canberkcakmak please use library version 2.1.0 and Ucrop.Options.setAspectRatioOptions method :octocat:

Woow :) you re really perfect. I will try today. Thanks man :)

Hi, i'm ,implement new version but, in the library build.gradle file compile 'com.android.support:appcompat-v7:24.0.0'
gives error for my application. i'm using 23.2.1. When open the app in device it crashed and not give any log. Then i'm change my 23.2.1 to 24.0.0. but it gives same error. How can i solve this ? any suggestion. Thanks so much

@canberkcakmak I have a project with 23.4.0 version of appcompat & it runs well. I don't think that there are no error logs at all, maybe you have to change your logs level visibility etc.
And of course, use clean.

Otherwise you can try to do this:

compile('com.android.support:appcompat-v7:23.2.1') {
    // force to use 23.2.1 even if another library resolves higher version
    force = true 
}

Ok. I download your library and implement manually my project and chage build.gradle with 23.2.1 it's perfectly worked. Thank you so much for update. :) have a nice day

(ノ◕ヮ◕)ノ*:・゚✧

sorry for open again :) and sorry for puzzling you. But my crop problem not solved i see. When i select my silly height photo firstly it shows original cropping. But when i clicked options it turns normal. here is my screenshot:
http://i.hizliresim.com/l14lmp.png

Can you post here your uCrop config?

UCrop.Options options = new UCrop.Options();
options.setCompressionFormat(Bitmap.CompressFormat.JPEG);
options.setCompressionQuality(100);
options.setToolbarColor(context.getResources().getColor(R.color.white));

    options.setToolbarWidgetColor(context.getResources().getColor(R.color.black));
    options.setStatusBarColor(context.getResources().getColor(R.color.colorPrimaryDark));

    options.setAspectRatioOptions(1,
            new AspectRatio("1:2", 1, 2),
            new AspectRatio("3:4", 3, 4),
            new AspectRatio("5:3", 5, 3),
            new AspectRatio("16:9", 16, 9),
            new AspectRatio("1:1", 1, 1));


    UCrop.of(srcUri, destUri)
            .withOptions(options)
            .start(context);

here

Yei, you've found a bug :) Gonna push hotfix later today

:) okey. Again thanks for perfect crop library. I've tried almost all libraries and i think this is the best.

I've pushed an update 2.1.1 - above issue should be fixed :)

And by the way, if use api like this, library automatically makes same title from given numbers & swaps them if user clicks on it again.

options.setAspectRatioOptions(1,
            new AspectRatio(null, 1, 2),
            new AspectRatio(null, 3, 4),
            new AspectRatio(null, 5, 3),
            new AspectRatio(null, 16, 9),
            new AspectRatio(null, 1, 1));

it is working perfectly :) thanks man have a nice day.

commented

And by the way, if use api like this, library automatically makes same title from given numbers & swaps them if user clicks on it again.

@shliama is there any option to disable swapping ?

How to enable free cropping?