Comments (13)
@Janekk That's strange, I can't replicate it - what version are you using and what crop params did you use? If you open demo/index.html
do you get the same behaviour?
from react-image-crop.
Just stumbled upon that in my React component, pretty basic one:
constructor() {
super();
this.state = {
dataUrl: null
};
this.crop = {
x: 20,
y: 10,
width: 60,
aspect: 3 / 4
};
}
render() {
var {dataUrl} = this.state;
return (
<div>
<input type="file" onChange={this.onFileChange.bind(this)}/>
{dataUrl ?
<ReactCrop crop={this.crop} src={dataUrl} onComplete={this.onCropComplete.bind(this)}/>
: null
}
</div>
);
}
Will try to test it in isolation to be sure that nothing from my project influences that behavior. Btw. @dominictobias how can I run your demo? I started it with npm dev
, webpack has started, but what url/port is it running on? Thanks
from react-image-crop.
Thanks I'll check this probably tomorrow. To run that that (without wanting
to modify the source) simply open up index.html - no need to start a server
On Friday, 22 January 2016, Janusz Kacalak [email protected] wrote:
Just stumbled upon that in my React component, pretty basic one:
constructor() {
super();this.state = { dataUrl: null }; this.crop = { x: 20, y: 10, width: 60, aspect: 3 / 4 };
}
render() {
var {dataUrl} = this.state;
return (
{dataUrl ?
: null
}
);
}Will try to test it in isolation to be sure that nothing from my project
influences that behavior. Btw. @dominictobias
https://github.com/DominicTobias how can I run your demo? I started it
with npm dev, webpack has started, but what url/port is it running on?—
Reply to this email directly or view it on GitHub
#14 (comment)
.
from react-image-crop.
I think I know what's going on with this issue.
Probably the image you're using is bigger in width than height.
But you're forcing the width to be 60% and letting react-image-crop to figure out the height. (Which will most likely be outside of the boundaries)
Take a look at the gif
A work around for this is to figure out before hand which values to pass to react-image-crop. Either pass width or height when the aspect is set, but don't do both.
from react-image-crop.
@Janekk can you tell by the gif if those were the problems you were experiencing?
from react-image-crop.
Thanks for the investigation @DPr00f , even if it's not that it's a good catch
from react-image-crop.
@DPr00f actually it was a vertical image, so it should be ok with settings from my snippet. I'll take a look today again
from react-image-crop.
@Janekk if you still have the problem please link to the image here and I'll try with those settings
from react-image-crop.
@dominictobias @DPr00f the problem turned out to be quite simple one to reproduce. Try adding something to the demo page above the file input, that takes some vertical space, so that you have scroll to the image crop area. Then try dragging the top corners. It might be something with the offset calculation (getElementOffset
?)
from react-image-crop.
Thanks that sounds easy to reproduce, I'll take a look later
from react-image-crop.
Fixed in 0.1.0
from react-image-crop.
Nice. Good job Dominic
from react-image-crop.
Thank you Dominic
from react-image-crop.
Related Issues (20)
- 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 3
- 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
- iPhone 15's 24 MP (res 4284 X 5712) image resolution is making the image black after cropping. HOT 1
- Library not supporting image cropping in iOS WebView HOT 6
- Add whitespace around image being cropped?
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.