A react native vision camera frame processor for cropping
react-native-vision-camera-cropper.mp4
For Vision Camera v3, use versions 0.x.
For Vision Camera v4, use versions >= 1.0.0 < 2.0.0
For Vision Camera v5, use versions >= 2.0.0
yarn add vision-camera-cropper
cd ios && pod installAdd the plugin to your babel.config.js:
module.exports = {
plugins: [['react-native-worklets/plugin']],
// ...Note: You have to restart metro-bundler for changes in the
babel.config.jsfile to take effect.
-
Crop a frame and return its base64 or path.
import { crop } from 'vision-camera-cropper'; // ... const frameOutput = useFrameOutput({ pixelFormat: 'yuv', onFrame: (frame) => { 'worklet'; const result = crop(frame, { cropRegion: cropRegionShared.value, includeImageBase64: true, }); frame.dispose(); }, });
-
Rotate an image.
const rotated = await rotateImage(base64,degree);
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library