Comments (17)
Nevermind, I see now that 1.1.1 is published and I have included it in Android Studio.
It works! Finally this library works very well for me and chosen/taken pictures are centred nicely in the cropping area by default.
from scissors.
@nshmura Good job.I have tried your method and it works well,thank you
from scissors.
Wondering the same thing. Taking a picture with the camera, and then after the camera activity result, I'm doing:
cropView.extensions().load(new File(newImageFilename));
But the image is bottom aligned to the base of the 'cropping square'...
from scissors.
Thanks for reporting this @liangricha / @mhousser do you have a sample image I can use to reproduce this?
from scissors.
@eveliotc well actually I'm launching the camera, then upon camera ActivityResult, I'm running this line:
cropView.extensions().load(new File(newImageFilename));
So I don't have a sample image per se - but let me try and get a screenshot.
from scissors.
First of all, my XML is pretty standard:
<com.lyft.android.scissors.CropView
android:id="@+id/crop_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cropviewViewportRatio="1"/>
Immediately after taking a picture with my camera and running this line:
cropView.extensions().load(new File(newImageFilename));
It's bottom-aligning to the crop square:
I would expect it to be vertically centred with the square, just like this (I dragged the image down to make it look like this):
from scissors.
@eveliotc and another alignment issue, this time when passing in a Uri
(from the chooser gallery) of an image that is in landscape mode.
It's right aligning, instead of being horizontally centered.
This time, it's via the line cropView.extensions().load(galleryImageUri);
Some screens. The gallery:
And after I run load
, it's aligning the right of the image with the right of the viewport/screen:
from scissors.
@eveliotc maybe this is just a setup issue.
I'm using Picasso, and so Scissors should be using Picasso to do its loading.
Am I missing somewhere a specific call to tell Picasso and/or Scissors to load things in 'center inside' mode (with respect to the scissors viewport)?
Starting to feel like this is just a setup issue (I missed a call somewhere), instead of an actual bug...
from scissors.
For the above gif, I used http://earthzine.org/wp-content/uploads/2015/08/image2.jpeg and called setViewportRatio(4.f)
in onCreate(...)
from scissors.
The same problem. If setViewportRatio() before the image is loaded,it's bottom-aligning to the crop square.If setViewportRatio() after the image is loaded,it will be center inside. so should i add a callback to image load?
from scissors.
@ZoroYouth are you saying there's currently an easy workaround? Just call setViewportRatio(1.0f)
after Picasso finishes loading an image, for example?
from scissors.
now i just wait 1 second to setViewportRatio. it solved my problem,but the way is terrible.
mCropView.postDelayed(new Runnable() {
@OverRide
public void run() {
mCropView.setViewportRatio(mRatio);
}
},1000);
from scissors.
I have same problem. Maybe this issue is caused by TouchManager#ensureInsideViewport() method call.
https://github.com/lyft/scissors/blob/master/scissors/src/main/java/com/lyft/android/scissors/TouchManager.java#L95
I sent the pull request #57 .
from scissors.
@eveliotc can we please accept the fix above and push out a new version? This library is quite broken when all the taken images are not centered by default..
from scissors.
@mhousser Fix was included for 1.1.1
@nshmura Thanks for the PR, please sign Lyft's CLA https://oss.lyft.com/cla/ to make it possible to incorporate your changes in the future.
from scissors.
@eveliotc is 1.1.1 available for Gradle inclusion in yet?
i.e. compile 'com.lyft:scissors:1.1.1'
from scissors.
@eveliotc Thank you. I done!
from scissors.
Related Issues (20)
- Can I use scissors library to crop an image taken with my camera? <question> HOT 1
- How to use CropView with Fresco? HOT 1
- GlideBitmapLoader.createUsing uses cropView size
- GlideBitmapLoader.createUsing uses cropView's size while it might not be laid out HOT 1
- Question: How come CropViewExtensions pickUsing Fragment, is not using the support fragment? HOT 2
- Is it possible to remove scaling ?
- Library fails loading images when using Glide v4 and causes exception.
- Crop to File, cannot access CropViewExtensions HOT 6
- Can't import HOT 1
- Can I get the cropped offsets? HOT 5
- Fresco Integration HOT 1
- Scissors 2 is not available on maven HOT 1
- Extensions are not compatible in Kotlin HOT 1
- Scissors 2 not published, support for RxJava2 HOT 1
- Exception with glide HOT 1
- Exception with Picasso latest (2.71828) HOT 3
- Error using with Picasso 2.5.2 HOT 1
- AndroidX HOT 1
- How to check if image has been cropped/modified ? HOT 1
- Select image not load into crop view HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scissors.