android-crop icon indicating copy to clipboard operation
android-crop copied to clipboard

Specify image crop dimensions

Open power7714 opened this issue 9 years ago • 9 comments

How can I ensure that every image I crop comes out at a 512x512 aspect ratio? Currently, some images come out way smaller than the target imageview

power7714 avatar Apr 25 '16 01:04 power7714

There is no functionality that allows for a min size, i will look into this

Lawgrin avatar Apr 28 '16 15:04 Lawgrin

I have made the changes however i cant see it being pulled anytime soon as i currently have a pending pull request. Here is my fork. You can now use: Crop.of(source, destination).withMinSize(512, 512).asSquare().start(this)

Lawgrin avatar Apr 28 '16 19:04 Lawgrin

Awesome. How would I use your fix via gradle?

power7714 avatar Apr 28 '16 22:04 power7714

@Lawgrin I figured out a temporary fix. I just created my own separate Crop class within my project and just pasted the code you modified. Works perfectly now. Thank you. Once the pull request is approved, I'll revert to using just the library.

power7714 avatar Apr 29 '16 04:04 power7714

You cant at the moment, im waiting on the @jdamcd for pull request

Lawgrin avatar Apr 29 '16 06:04 Lawgrin

@power7714 I have never made a maven repo, still reading up on it

Lawgrin avatar Apr 29 '16 06:04 Lawgrin

@power7714 @Lawgrin Hello, so i'm a super beginner and wondering if i should be able to just add the .withMinSize(512, 512) inside the code and then it should work or do i need to do something else(which i assume, like how should the class look like)? since i've tried this without success, thanks!

matte5031 avatar Jul 03 '16 17:07 matte5031

@matte5031 the way I did it was I went to lawgrin's fork and copied the "crop" class code. I then created my own crop class within my project and posted the code in it. Then you can put the line of code that lawgrin mentioned to get the size you want. Hope that helps. If you need anymore help just let me know

power7714 avatar Jul 03 '16 20:07 power7714

@power7714 Ye okay so i copy the file Crop.java from the fork which is inside ..lib\src\main\java\com\soundcloud\android\crop correct? I'm not quite sure on how to change the class since this class is imported from the original plugin that i try to use. Here is the original plugin/question that i'm trying to use which relies on this plugin and where the creator refered to this code(I've tried to just remove the import and add the modified Crop.java file in the same folder without success). I know this is not what you've done therefore i don't expect you to have a solution to my problem but, the file/class previously mentioned is the one that needs to be changed to the forked one correct? Thanks alot i appreciate it

matte5031 avatar Jul 04 '16 14:07 matte5031