All Projects → vemarav → react-native-avatar-crop

vemarav / react-native-avatar-crop

Licence: MIT license
Highly customisable <Crop /> component for React Native < 💅 >

Programming Languages

typescript
32286 projects
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
Starlark
911 projects
javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to react-native-avatar-crop

Rskimagecropper
An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation.
Stars: ✭ 2,371 (+4944.68%)
Mutual labels:  crop, cropper, cropping
Tocropviewcontroller
A view controller for iOS that allows users to crop portions of UIImage objects
Stars: ✭ 4,210 (+8857.45%)
Mutual labels:  crop, cropper, cropping
React Cropper
Cropperjs as React component
Stars: ✭ 1,600 (+3304.26%)
Mutual labels:  crop, cropper
Krop
Small widget for image cropping in Instagram-like style
Stars: ✭ 107 (+127.66%)
Mutual labels:  crop, cropper
Pixelsdk
The modern photo and video editor for your iPhone / iPad app. A fully customizable image & video editing iOS Swift framework.
Stars: ✭ 192 (+308.51%)
Mutual labels:  crop, cropping
React Easy Crop
A React component to crop images/videos with easy interactions
Stars: ✭ 1,093 (+2225.53%)
Mutual labels:  crop, cropping
Svelte Easy Crop
A Svelte component to crop images with easy interactions
Stars: ✭ 80 (+70.21%)
Mutual labels:  crop, cropping
Cropiwa
📐 Configurable Custom Crop widget for Android
Stars: ✭ 2,185 (+4548.94%)
Mutual labels:  crop, cropper
React Native Image Crop Picker
iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
Stars: ✭ 5,261 (+11093.62%)
Mutual labels:  crop, cropping
mpv-scripts
dynamic-crop.lua script for mpv player/lib.
Stars: ✭ 43 (-8.51%)
Mutual labels:  crop, cropping
Igrphototweaks
Drag, Rotate, Scale and Crop
Stars: ✭ 212 (+351.06%)
Mutual labels:  crop, cropping
Cropper
Android Library for cropping an image at ease.
Stars: ✭ 21 (-55.32%)
Mutual labels:  crop, cropper
Alloycrop
The best and tiny size mobile cropping component - 做最好且最小的移动裁剪组件
Stars: ✭ 907 (+1829.79%)
Mutual labels:  crop, cropping
Croppy
Image Cropping Library for Android
Stars: ✭ 906 (+1827.66%)
Mutual labels:  crop, cropper
ngx-cropper
An Angular image plugin, includes upload, cropper, save to server.
Stars: ✭ 14 (-70.21%)
Mutual labels:  crop, cropper
Prynttrimmerview
A set of tools to trim, crop and select frames inside a video
Stars: ✭ 553 (+1076.6%)
Mutual labels:  crop, cropping
Pdfcropmargins
pdfCropMargins -- a program to crop the margins of PDF files
Stars: ✭ 141 (+200%)
Mutual labels:  crop, cropper
Croppr.js
A vanilla JavaScript image cropper that's lightweight, awesome, and has absolutely zero dependencies.
Stars: ✭ 294 (+525.53%)
Mutual labels:  crop, cropper
react-simple-crop
✂️ A React component library for cropping and previewing images
Stars: ✭ 19 (-59.57%)
Mutual labels:  crop, cropper
Android Imagecropview
android image crop library
Stars: ✭ 225 (+378.72%)
Mutual labels:  crop, cropping

react-native-avatar-crop

Supports rect and circle cropping. Use cropArea={{width, height}} for custom aspect ratio.

Download apk to see it in action, click to download


Image Picker Network Image
video video

Installation

Note: Please migrate to @react-native-masked-view/masked-view if using @react-native-community/masked-view

npm

npm install react-native-avatar-crop vemarav/react-native-image-editor react-native-image-size @react-native-masked-view/masked-view  @react-native-gesture-handler --save

yarn

yarn add react-native-avatar-crop vemarav/react-native-image-editor react-native-image-size @react-native-masked-view/masked-view  @react-native-gesture-handler

Usage

const component = (props) => {
  const { uri, setUri } = useState("");
  let crop;
  const { width: SCREEN_WIDTH } = Dimensions.get("window");

  const cropImage = async () => {
    // crop accepts quality, default is 1
    // uri will have cropped image cache path
    const { uri, width, height } = await crop(0.9);
    setUri(uri);
  };

  return (
    <View>
      {uri ? (
        <Image
          source={{ uri }}
          style={{
            width: SCREEN_WIDTH,
            height: SCREEN_WIDTH,
            resizeMode: "contain",
          }}
        />
      ) : null}
      <Crop
        source={props.uri}
        cropShape={"circle"} // rect || circle
        width={SCREEN_WIDTH} // default value
        height={SCREEN_WIDTH} // defalt value
        cropArea={{
          width: SCREEN_WIDTH / 1.3, // required
          height: SCREEN_WIDTH / 1.3, // required
        }}
        borderWidth={0} // default 2
        backgroundColor={"#FFFFFF"} // default #FFFFFF, use same format
        opacity={0.7} // between 0 and 1, default is 1
        maxZoom={3} // default 3
        resizeMode={"contain"} // default "cover"
        onCrop={(cropCallback) => (crop = cropCallback)} // returns a function
      />
    </View>
  );
};

see full example here

CONTRIBUTING

  1. Whether you are a novice or experienced software developer, all contributions and suggestions are welcome!

    Clone repo

    git clone https://github.com/vemarav/react-native-avatar-crop.git

  2. Add features or bug fixes

  3. Make a Pull Request

    OR

    Report a bug here

    Feel free to contribute, hosted on ❤️ with Github.

TODO

  • Add rotation support

LICENSE

Package published under MIT License

Author

LIKED IT

Please use following button to star the, so it can reach others too

SOCIAL

Twitter Follow

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].