Comments (21)
I still get this error, with the following setup:
<ReactCrop crop={{ aspect: 1, width: 100, top: 0, x: 20 }} src={newProfilePhoto.preview} />
This is in v2.0.2
.
from react-image-crop.
from react-image-crop.
Hi, that's strange I'm not getting the same error with those params on OSX Chrome 50.0.2661.102 (64-bit) or 51.0.2704.79 (64-bit). What Chrome version are you using? And does it error on any image you try?
from react-image-crop.
Closing but feel free to update
from react-image-crop.
@CanadaJ I was having this issue. I later found that I was accidentally passing "1:1"
for the aspect, instead of 1/1
. I suggest checking everything twice.
from react-image-crop.
I was having this issue then found that I was passing string "1/1"
not the number 1/1
which is 1
from react-image-crop.
Same issue. All Browser appear. Has it been fixed?
from react-image-crop.
from react-image-crop.
Sorry, inspect what? The actual DOM?
The line this error complains about is:
node.setAttribute(attributeName, '' + value);
from react-image-crop.
from react-image-crop.
In that case I'm not really sure what you're asking, but no - there is no immediately obvious DOM node with a crossorigin
attribute.
from react-image-crop.
The error:
DOMPropertyOperations.js?17f3:142 Error: <polygon> attribute points: Expected number, "0.2 0, 1 0, 1 NaN, 0.2 NaN".
The config:
<ReactCrop
crop={{ aspect: 1, width: 100, top: 0, x: 20 }}
src={photo.preview}
onComplete={this.setCroppingData}
onImageLoaded={(crop, image, pixelCrop) => this.setCroppingData(crop, pixelCrop)}
/>
Generally speaking, this error looks like it's being thrown from React source code. Interestingly, as OP stated, it doesn't affect actual functionality whatsoever, at least as far as I can tell.
from react-image-crop.
Hm I can't replicate using that crop prop. In getPolygonValues(forSvg) {
function put console.log(crop.x, crop.y, crop.height)
, I have a feeling your crop.height could be not a number
from react-image-crop.
Yes, that's it exactly. Seems that function is called a few times, one of which crop.height
was NaN
. What can I do to prevent this?
from react-image-crop.
I am guessing that at some point something unusual is being pass into the cropper, try in your render method logging out the crop props you are passing in, maybe one of them is not a number, or a number as a string or something. If not I'll have to try and get a reproducible example to debug.
from react-image-crop.
As per my initial post:
<ReactCrop crop={{ aspect: 1, width: 100, top: 0, x: 20 }} src={newProfilePhoto.preview} />
That is what I am passing in. They are all integers. No strings, no NaN
, nothing except valid integers.
I am never even sending height, so however it is being assigned NaN
is happening within react-image-crop
.
from react-image-crop.
from react-image-crop.
Browser: Chrome, Version 56.0.2924.87 (64-bit) [OSX]
react-image-crop: v2.0.2
Image: https://i.imgur.com/diacaXd.png
from react-image-crop.
The only thing I can think is that it's related to the fact that the x
value in combination with the aspect
value forces a recalculation of the width
value (I assume this is happening somewhere in your code).
from react-image-crop.
I can't replicate your issue by using that crop and choosing that image (using react-image-crop/demo/index.html). It's likely something else you're doing but I can't solve it unless you can provide a working example of the error sorry
from react-image-crop.
That is a working example, I assure you. I can reproduce with just that data in a clean environment. At any rate, like I have said it doesn't seem to inhibit functionality so it's not a priority for me.
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.