react-image-crop: Aspect ratio in Chrome throws console errors
I’m using the latest (1.0.0-rc3) version of react-image-crop with the following crop attributes:
const cropAttributes = {
width: 100,
height: 12,
x: 0,
y: 0,
aspect: 1663/200
}
and I’m receiving the following error in the Chrome console:
Error: <polygon> attribute points: Expected number, "0 0, 1 0, 1 NaN, 0 NaN".
Interestingly enough, this error has no effect on the crop. Everything works as expected, the aspect ratio is locked, the height, width, and coordinates are also correct, even with different values.
It seems that the inclusion of aspect in the attributes is the only thing that causes this error. Also, if the aspect is the only attribute specified, no error occurs:
const cropAttributes = {
aspect: 1663/200
}
I suspect this might be an issue with webkit but I’m not 100% certain.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 21 (9 by maintainers)
Commits related to this issue
- Dont set crossorigin by default, fixes #37. Remove ellipses option. Fix eslint issues. Add imageAlt prop. — committed to sekoyo/react-image-crop by deleted user 7 years ago
Hey sorry, I probably shouldn’t answer stuff when I’m drunk I’m a bar 😃 I thought this was regarding a different issue. Are you getting the same error as the OP? What does it say and what are you passing in as props?
On Sat, 25 Feb 2017 at 11:21, Isaac Hinman notifications@github.com wrote:
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.