{"id":26666497,"url":"https://github.com/rodsarhan/react-native-image-editor-ui","last_synced_at":"2025-03-25T18:35:18.820Z","repository":{"id":281017533,"uuid":"943935406","full_name":"RodSarhan/react-native-image-editor-ui","owner":"RodSarhan","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-06T14:11:30.000Z","size":1388,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T15:25:12.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/RodSarhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-06T14:08:55.000Z","updated_at":"2025-03-06T14:11:33.000Z","dependencies_parsed_at":"2025-03-06T15:35:19.854Z","dependency_job_id":null,"html_url":"https://github.com/RodSarhan/react-native-image-editor-ui","commit_stats":null,"previous_names":["rodsarhan/react-native-image-editor-ui"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodSarhan%2Freact-native-image-editor-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodSarhan%2Freact-native-image-editor-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodSarhan%2Freact-native-image-editor-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RodSarhan%2Freact-native-image-editor-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RodSarhan","download_url":"https://codeload.github.com/RodSarhan/react-native-image-editor-ui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245521303,"owners_count":20629055,"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":[],"created_at":"2025-03-25T18:35:18.082Z","updated_at":"2025-03-25T18:35:18.806Z","avatar_url":"https://github.com/RodSarhan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Image Editor UI\n\nJS based image editor ui for react native that relies on reanimated and gesture handler\n\n## Installation\n\n```sh\nnpm install react-native-image-editor-ui\n```\n\n## Usage\n\n```tsx\nimport {ImageManipulationView, type ImageManipulationMethods} from 'react-native-image-editor-ui';\n// This is just an example, you can use some other image editing library\nimport {ImageManipulator} from 'expo-image-manipulator';\n\nconst App = () =\u003e {\n    const [savedImageUri, setSavedImageUri] = useState\u003cstring\u003e();\n    const imageManipulationRef = useRef\u003cImageManipulationMethods\u003e(null);\n\n    const onPressReset = imageManipulationRef.current?.reset();\n    const onFlipX = imageManipulationRef.current?.flipX();\n    const onFlipY = imageManipulationRef.current?.flipY();\n    const onPressRotateRight = imageManipulationRef.current?.rotateRight();\n\n    const onPressSave = useCallback(async () =\u003e {\n        const editResults = await imageManipulationRef.current?.save();\n        if (!editResults) return;\n        // You can use any other library\n        // The order of transformations matters and follow this\n        // Flip -\u003e Rotate -\u003e Crop\n        const context = ImageManipulator.manipulate(sampleUri);\n        if (editResults.isFlippedX) {\n            context.flip('horizontal');\n        }\n        if (editResults.isFlippedY) {\n            context.flip('vertical');\n        }\n        if (editResults.rotation !== 0) {\n            context.rotate(editResults.rotation);\n        }\n        context.crop({\n            height: editResults.cropHeight,\n            width: editResults.cropWidth,\n            originX: editResults.cropLeftOffset,\n            originY: editResults.cropTopOffset,\n        });\n        const renderResult = await context.renderAsync();\n        const image = await renderResult.saveAsync();\n        // Do something with the resulting image\n        setSavedImageUri(image.uri);\n    }, []);\n\n    return (\n        \u003cView style={{flex: 1}}\u003e\n            {/* you can add your custom buttons */}\n            \u003cImageManipulationView \n                style={{flex: 1}}\n                source={{uri: sampleUri}}\n                ref={imageManipulationRef}\n            /\u003e\n        \u003c/View\u003e\n    )\n}\n```\n\n## TODO\n\n- [ ] Fix rotations for aspect ratios other than 1\n- [ ] Improve zooming functionality and moving the image around\n- [ ] Document the features and limitations\n- [ ] Publish to npm\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT\n\n---\n\nMade with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodsarhan%2Freact-native-image-editor-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frodsarhan%2Freact-native-image-editor-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frodsarhan%2Freact-native-image-editor-ui/lists"}