{"id":20643489,"url":"https://github.com/st0ffern/react-native-image-cropper","last_synced_at":"2025-08-20T06:33:04.770Z","repository":{"id":40295960,"uuid":"61870759","full_name":"st0ffern/react-native-image-cropper","owner":"st0ffern","description":"Crop your images with zoom and pan","archived":false,"fork":false,"pushed_at":"2022-12-07T09:16:14.000Z","size":848,"stargazers_count":158,"open_issues_count":32,"forks_count":67,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-12-08T15:49:01.941Z","etag":null,"topics":["cropper","image-cropper","pan","react-native"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-image-cropper","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/st0ffern.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-24T08:46:04.000Z","updated_at":"2024-02-02T13:24:36.000Z","dependencies_parsed_at":"2023-01-24T15:31:01.693Z","dependency_job_id":null,"html_url":"https://github.com/st0ffern/react-native-image-cropper","commit_stats":null,"previous_names":["stoffern/react-native-image-cropper"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0ffern%2Freact-native-image-cropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0ffern%2Freact-native-image-cropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0ffern%2Freact-native-image-cropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st0ffern%2Freact-native-image-cropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/st0ffern","download_url":"https://codeload.github.com/st0ffern/react-native-image-cropper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230400616,"owners_count":18219831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cropper","image-cropper","pan","react-native"],"created_at":"2024-11-16T16:12:56.928Z","updated_at":"2024-12-19T08:08:38.674Z","avatar_url":"https://github.com/st0ffern.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-image-cropper ![](https://img.shields.io/npm/v/react-native-image-cropper.svg) ![](https://img.shields.io/badge/gl--react-\u003e=2.1-05F561.svg) ![](https://img.shields.io/badge/gl--react--native-\u003e=2.28.0-05F561.svg)\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/stoffern/react-native-image-cropper.svg)](https://greenkeeper.io/)\n\nThis Image cropper is based on the gl-react-native [library](https://github.com/ProjectSeptemberInc/gl-react-native)\n\n![Cropping View](https://media.giphy.com/media/l46CDga4bxZccVxWU/giphy.gif)\n\n## Installation\n```\nnpm i -S react-native-image-cropper\n```\nor\n```\nyarn add react-native-image-cropper\n```\n\n## Requirements\n- `gl-react` You need to install gl-react. `npm i -S gl-react` \n- `gl-react-native` You need to install gl-react-native and link the repo in RN. `npm i -S gl-react-native \u0026 rnpm link` \n- `react-native` Android requires you to have RN 0.28 or higher!\n\n#### `{ImageCrop}` Props\n- `image` **(required)**: uri to image that should be cropped.\n- `cropHeight` **(required)**: height of the image in cropped size.\n- `cropWidth` **(required)**: width of the image in cropped size.\n- `zoom`: range 0 - 100 setting zoom value. where 100 = full zoom. (default: 0)\n- `maxZoom`: max zoom value, should be bigger than minZoom value (default: 100)\n- `minZoom`: min zoom value, should be smaller than maxZoom value (default: 0) \n- `panToMove`: Use pan to move image? (default: true)\n- `pinchToZoom` Use pinch to zoom image? (default: true)\n- `quality`: a value from 0 to 1 to describe the quality of the snapshot. 0 means 0% (most compressed) and 1 means 100% (best quality). (default: 1)\n- `type`: the file type default value is **\"png\"**, **\"jpg\"** is also supported. Refer to implementations to see more supported values. (default: jpg)\n- `format`: the format of the output. Supported values: **\"base64\"**, **\"file\"**. (default: base64)\n- `filePath`: if format is **\"file\"**, the path to write the image to (default: \"\")\n- `pixelRatio`: the pixel ratio to use for the rendering. By default the screen pixel scale will be used.\n\n#### `{ImageCrop}` Functions\n- `crop()`: returns a base64 encoded image.\n\n\n## Example\n```js\n...\nimport {ImageCrop} from 'react-native-image-cropper'\n\n\n...\nrender() {\n  return (\n  \u003cView\u003e\n    \u003cImageCrop \n      ref={'cropper'}\n      image={this.state.image}\n      cropHeight={this.state.height}\n      cropWidth={this.state.width}\n      zoom={this.state.zoom}\n      maxZoom={80}\n      minZoom={20}\n      panToMove={true}\n      pinchToZoom={true}\n    /\u003e\n    \u003cText onPress={this.capture()}\u003eCapture()\u003c/Text\u003e\n  \u003c/View\u003e\n    \n  )\n} \ncapture(){\n  this.refs.cropper.crop()\n  .then(base64 =\u003e console.log(base64))\n}\n...\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst0ffern%2Freact-native-image-cropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fst0ffern%2Freact-native-image-cropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst0ffern%2Freact-native-image-cropper/lists"}