
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
rc-cropper
Advanced tools
An react component wrapping the Cropperjs.
Install via npm
npm install --save rc-cropper
Inspired by react-cropper
import React, {Component} from 'react'
import Cropper from 'rc-cropper'
class Demo extends Component {
crop(){
const canvas = this.refs.cropper.getCroppedCanvas()
const url = canvas.toDataURL() // image url
const blob = canvas.toBlob(blob => {
// upload the blob or do anything else
})
}
render() {
const options = {
aspectRatio: 16 / 9
}
return (
<Cropper
ref='cropper'
src='http://fengyuanchen.github.io/cropper/images/picture.jpg'
options={options} />
)
}
}
| name | type | default | description |
|---|---|---|---|
| src | string | image src | |
| className | string | custom class name | |
| locale | object | for i18n | |
| zoomStep | number | 0.2 | zoom step |
| moveStep | number | 2px | move step |
| rotateStep | number | 45deg | rotate step |
| onReady | function | callback when the cropper is ready | |
| showActions | bool | false | whether show action buttons, support zoom/move/rotate |
| outputImgSize | object | specify the output canvas size, format: {width: *, height: *} | |
| containerSizeLimit | object | { maxWidth: 500, maxHeight: 500, minWidth: 50, minHeight: 50} | the size limitation of image container |
| cropBoxEditable | bool | true | Whether the cropbox width and height can edit by input. If outputImgSize is set, this property would be invaild |
| options | object | options for cropperjs |
Note:
outputImgSize is specified and no aspectRatio specified in options, rc-cropper will caculate the aspectRatio based on outputImgSize automatically. aspectRation = outputImgSize.width / outputImgSize.heightFAQs
Cropper as React components
The npm package rc-cropper receives a total of 12 weekly downloads. As such, rc-cropper popularity was classified as not popular.
We found that rc-cropper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.