@exodus/image-editor
TypeScript icon, indicating that this package has built-in type declarations

2.3.0-exodus.1 • Public • Published

react-native-image-editor

Image Editor Native module for React Native.

Build Status Version MIT License PRs Welcome Lean Core Badge

Getting started

Install

yarn add @react-native-community/image-editor

or

npm install @react-native-community/image-editor --save

Install Pods

npx pod-install

Link

react-native link @react-native-community/image-editor

Usage

Start by importing the library:

import ImageEditor from "@react-native-community/image-editor";

Crop image

Crop the image specified by the URI param. If URI points to a remote image, it will be downloaded automatically. If the image cannot be loaded/downloaded, the promise will be rejected.

If the cropping process is successful, the resultant cropped image will be stored in the cache path, and the URI returned in the promise will point to the image in the cache path. Remember to delete the cropped image from the cache path when you are done with it.

  ImageEditor.cropImage(uri, cropData).then(url => {
    console.log("Cropped image uri", url);
  })

cropData

Property Required Description
offset Yes The top-left corner of the cropped image, specified in the original image's coordinate space
size Yes Size (dimensions) of the cropped image
displaySize No Size to which you want to scale the cropped image
resizeMode No Resizing mode to use when scaling the image (iOS only, android resize mode is always 'cover') Default value: 'contain'
  cropData = {
    offset: {x: number, y: number},
    size: {width: number, height: number},
    displaySize: {width: number, height: number},
    resizeMode: 'contain' | 'cover' | 'stretch',
  };

For more advanced usage check our example app.

Package Sidebar

Install

npm i @exodus/image-editor

Weekly Downloads

662

Version

2.3.0-exodus.1

License

MIT

Unpacked Size

50.5 kB

Total Files

20

Last publish

Collaborators

  • tunguyennnnn
  • dimartiro
  • cdotta-exodus
  • awesomeniko
  • mbaraniak-exodus
  • maksim-iv-exodus
  • hasakura
  • milanvojnovic
  • olerass-exodus
  • kklash
  • shehryar6
  • rec
  • awilson-rs
  • ggabarrin-rs
  • r4vn
  • exorich
  • cryptosgr
  • mol0d
  • yevhenii_molodyk
  • yilmazbahadir
  • muratso
  • exoleo
  • 633kh4ck
  • ossel
  • davidfraga610
  • clarkexo
  • andrewrexo
  • james-gre
  • juraex
  • richayotte
  • ralph.ba
  • angelloz
  • joshuabot
  • jamiemaw
  • exodus-justin.za
  • javiexodus
  • rg911
  • alex.alexandrius
  • filipexodus
  • ryansquared-npm
  • andrescarreon
  • florianmathieu
  • janwe
  • fboucquez
  • skapala
  • umito
  • lanahizzle
  • iaacek
  • ps.mcnally
  • akinncar
  • matias.la
  • voltagebots
  • kwwood
  • sergii_bo
  • lekzd
  • alexandrbbm
  • danh.t.vo
  • ezenwankwogabriel
  • meniem
  • mzndako
  • kevva
  • feri42
  • jprichardson
  • farisissa
  • ryanzim
  • headfire
  • gutenye
  • mosesbot
  • roccomuso
  • dcastagnoli
  • sonaye
  • nareg_exodus
  • ves
  • tenaciousmv
  • asyakost
  • bulgakovk
  • chalker
  • andrejb
  • jaydp17
  • olistic
  • joepie91
  • merlz
  • vbonini
  • devopsrobot
  • jenish-sojitra
  • nachoalvarez
  • giovannirco
  • diegomura
  • lanre-mark
  • sunilagrawal
  • guillecura
  • mariosvlad
  • federico-po
  • pagan404