
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
react-image-cropper
Advanced tools
A React.JS Image Cropper Touch supported
Custom:
import {Cropper} from 'react-image-cropper'
styles are all inline
define Cropper with src, and ref to execute crop method
<Cropper
src="http://braavos.me/images/posts/college-rock/the-smiths.png"
ref={ ref => { this.cropper = ref }}
/>
image.src = this.cropper.crop()
const values = this.cropper.values()
values:
{
// display values
display: {
width, // frame width
height, // frame height
x, // original x position
y, // original y position
imgWidth, // img width
imgHeight, // img height
},
// original values
original: {
width, // frame width
height, // frame height
x, // original x position
y, // original y position
imgWidth, // img width
imgHeight, // img height
}
}
(values) => onChange(values)
prop | value |
---|---|
ratio | width / height |
width | cropper frame width |
height | cropper frame height |
originX | cropper original position(x axis), accroding to image left |
originY | cropper original position(Y axis), accroding to image top |
fixedRatio | turn on/off fixed ratio (bool default true) |
allowNewSelection | allow user to create a new selection instead of reusing initial selection (bool default true) |
styles | specify styles to override inline styles |
onImgLoad | specify fuction callback to run when the image completed loading |
beforeImgload | specify function callback to run when the image size value is ready but image is not completed loading |
onChange | triggred when dragging stop, get values of cropper |
FAQs
react image crop
The npm package react-image-cropper receives a total of 760 weekly downloads. As such, react-image-cropper popularity was classified as not popular.
We found that react-image-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 MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.