Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
react-native-photo-cropper
Advanced tools
React Native Image Cropper, inspired by Instagram
npm install react-native-photo-cropper --save
or
yarn add react-native-photo-cropper
cd ios && pod install && cd ..
import React, {useState} from 'react';
import {Image, StyleSheet, Text, View} from 'react-native';
import PhotoCropper from 'react-native-photo-cropper';
const App = () => {
const [croppedImage, setCroppedImage] = useState<string | null>(null);
return (
<View >
<PhotoCropper
onCropped={data => setCroppedImage(data.croppedUri)}
image={{
width: 1600,
height: 700,
uri: 'https://dummyimage.com/1600x700/b5b5b5/ffffff.png',
}}
/>
<Text>Cropped image</Text>
{croppedImage && (
<Image source={{uri: croppedImage}} style={styles.image} />
)}
</View>
);
};
export interface PhotoCropperProps {
image: { // required
uri: string;
width: number;
height: number;
};
width?: number; // default Dimensions.get('window').width
height?: number; // default Dimensions.get('window').width
grid?: boolean; // default true
gridVerticalNum?: number; // default 2
gridHorizontalNum?: number; // default 2
gridColor?: string; // default '#fff'
onCropped?: (data: CroppedData) => void;
maxScale?: number; // default 2 / range 1 ~ ∞
initialX?: number;
initialY?: number;
initialScale?: number; // default 1
initialOpacity?: number; // default 1
}
export interface CroppedData {
croppedUri: string;
originalUri: string;
croppedArea: {
width: number;
height: number;
x: number;
y: number;
}
}
FAQs
The photo cropper component, similar to Instagram's.
The npm package react-native-photo-cropper receives a total of 10 weekly downloads. As such, react-native-photo-cropper popularity was classified as not popular.
We found that react-native-photo-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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.