0.2.1 โ€ข Published 1 year ago

expo-crop-image v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

๐Ÿš€ How to install

npm install expo-crop-image

ImageEditor

isRequired if there is a * in the name field

nameProptypesDescription
imageUri *stringImage address that will be used for cropping
fixedAspectRatio *numberExpect => aspect ratio.
minimumCropDimensions(size)Expect => {width: number, height: number} Default 100 X 100.
onEditingCancel *funcvoid
onEditingComplete *funcReturns image object (image object fields => uri, width, height).
editorOptionsobjectCustomize appearance of editor
processingComponentReactNodeCustomize appearance of loading between process

Example

import { ImageEditor } from "expo-crop-image";

<ImageEditor
  imageUri={uri}
  fixedAspectRatio={2 / 3}
  minimumCropDimensions={{
    width: 50,
    height: 50,
  }}
  onEditingCancel={() => {
    console.log("onEditingCancel");
  }}
  onEditingComplete={(image) => {
    console.log(image);
  }}
/>;

Editor Options

import { ImageEditor } from "expo-crop-image";

<ImageEditor
  ...
  editorOptions={{
    ...
  }}
/>;

type EditorOptions = {
  backgroundColor?: string
  controlBar?: {
    position?: 'top' | 'bottom'
    backgroundColor?: string
    height?: number
    cancelButton?: IconProps
    cropButton?: IconProps
    backButton?: IconProps
    saveButton?: IconProps
  }
  coverMarker?: {
    show?: boolean
    color?: string
  }
  gridOverlayColor?: string
  overlayCropColor?: string
}

type IconProps = {
  color: string
  text: string
  iconName: FeatherIconNames | MaterialIconNames
}

๐Ÿงช Technologies

This project was developed using the following technologies:

๐Ÿ“Œ Requirements

To use this package you have to install the following dependencies

๐Ÿš€ How to run locally

Clone the project and access the folder.

git clone https://github.com/NitoBa/expo-crop-image.git

cd expo-crop-image && npm install
cd example-app && npm install && cd ..

Compile the package locally

# build the package locally
npm run build:dev
# watch to changes while running with app
npm run build:watch

๐Ÿ“ License

This project is licensed under the MIT License. See the LICENSE file for details.

Made with ๐Ÿ’œ by Bruno Alves ๐Ÿ‘‹

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

10.0.0

2 years ago

6.0.0

2 years ago

5.0.0

2 years ago

3.0.0

2 years ago

1.0.5

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.1

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago