Comments (7)
Hi @yury-dymov, I'm having trouble replicating this. What are you passing in initialValue
? Your code would be a little simpler/more efficient if it was attaching the crop state to this.state.crop
(no need for destructuring then). Also unless you need to update the state each pixel(ish) change as the crop is being dragged it's usually ok to just update the state in onCropComplete
.
My guess is that when they are clicking in the next box, a parent component is being re-rendered/setting some prop, and that is causing that component to re-render with some different values - but then it's strange that you can't adjust the crop afterwards - can you also not drag it? Maybe put debugger;
statement in the render to see if it's being re-rendered when you click into the next input and see what values are being passed through. Let me know how it goes!
from react-image-crop.
@dominictobias, thank you for response.
I figured out the following:
- I uploaded 200x400 image (it should be not a square image)
- My initialValue is {x: 0, y: 0, width: 100, height: 100, aspect: 1}
3a) If I change initialValue to {...,width:30, height:30, ...} everything works fine.
3b) If I change initialValue to {...,width:90, height:90, ...} everything works fine but aspect is broken after performing steps mentioned in the initial message.
In my workflow I would like to have initial square selection with starting point at (0, 0) and side length of min(image_width, image_height).
Update: if I pass only height:100 or width:100, than the issue occurs if longer side was sent and not occurs otherwise
from react-image-crop.
Thanks for the extra details - interesting, sounds like a bug to me I'll take a look
from react-image-crop.
I fixed at least one of the issues - are you still having issues when upgrading to 1.0.0-rc2
?
from react-image-crop.
P.S. There are some gotchas when specifying both the width and height with a fixed aspect as this is using percentages - for example 90% & 90% on an image that isn't square would mean that the crop couldn't be square so it has to adjust one of the values. Actually I noticed that at the moment it's adjusting both of them so I need to look into that.
from react-image-crop.
@dominictobias for my case both issues are resolved. Thank you!
from react-image-crop.
Ah great!
On Monday, 25 April 2016, Yury Dymov [email protected] wrote:
@dominictobias https://github.com/DominicTobias for my case both issues
are resolved. Thank you!—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#31 (comment)
from react-image-crop.
Related Issues (20)
- Not able to catch exact crop image HOT 1
- outline is not circled with circularCrop in safari browser HOT 1
- ログイン、新規ユーザー作成処理の実装
- when we have circularCrop as prop, how to set the points on circle? HOT 3
- Need to rotate selected(croped) image HOT 4
- Synchronization Issue Between Multiple Cropper Instances on the Same Page HOT 2
- Image Cropping with 8/3 Aspect Ratio Causing Loss of Half Portion After Retrieval for s3 HOT 2
- Canvas toBlob crop not working on Sandbox (iOS) HOT 5
- Crop mask stays present with zero-size crop HOT 1
- SecurityError: OffscreenCanvas.convertToBlob: Cannot get blob from write-only canvas. HOT 1
- Canvas returns null after cropping image iOS HOT 1
- Mask is does'nt showing the first time HOT 6
- Memory leak risk due to event listeners not removed on componentWillUnmount HOT 1
- mask does not fully cover the image when the image to a smaller aspect ratio HOT 2
- Multiple crop selection on an image at the same time HOT 1
- Can the cropper be used for outpainting?
- React Crop as Dialog Box
- The previous image layout still be kept after switch image
- Feature request: Add the option to rotate the crop selection
- Proportional Stretching of Crop Box
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 react-image-crop.