{"id":13472013,"url":"https://github.com/prscX/react-native-photo-editor","last_synced_at":"2025-03-26T15:31:10.086Z","repository":{"id":32916032,"uuid":"146109896","full_name":"prscX/react-native-photo-editor","owner":"prscX","description":"React Native: Native Photo Editor","archived":false,"fork":false,"pushed_at":"2023-06-01T10:02:41.000Z","size":18100,"stargazers_count":1120,"open_issues_count":105,"forks_count":244,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-25T08:49:44.974Z","etag":null,"topics":["android","ios","react-native"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prscX.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-08-25T16:09:26.000Z","updated_at":"2024-10-20T23:14:02.000Z","dependencies_parsed_at":"2024-01-16T06:10:09.869Z","dependency_job_id":"5b1e326d-8b7c-480d-a59a-8f22d040399e","html_url":"https://github.com/prscX/react-native-photo-editor","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-photo-editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-photo-editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-photo-editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prscX%2Freact-native-photo-editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prscX","download_url":"https://codeload.github.com/prscX/react-native-photo-editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222061365,"owners_count":16924680,"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":["android","ios","react-native"],"created_at":"2024-07-31T16:00:51.125Z","updated_at":"2024-10-30T02:31:17.879Z","avatar_url":"https://github.com/prscX.png","language":"Java","funding_links":["https://www.buymeacoffee.com/prscX"],"categories":["Java"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://lh3.googleusercontent.com/dsJXfHnUx0qvZIB_80F-q0iN18eIqmx6g10bmsVN8R6nEnLQDKvJ9lXCbnPCgDEZMw=s180\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/react-native-photo-editor\"\u003e\u003cimg src=\"http://img.shields.io/npm/v/react-native-photo-editor.svg?style=flat\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prscX/react-native-photo-editor/pulls\"\u003e\u003cimg alt=\"PRs Welcome\" src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/prscX/react-native-photo-editor#License\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/react-native-photo-editor.svg?style=flat\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n    ReactNative: Native Photo Editor (Android/iOS)\n\nIf this project has helped you out, please support us with a star 🌟\n\u003c/h1\u003e\nThis library is a React Native bridge around native photo editor libraries. It allows you to edit any photo by providing below set of features:\n\n\n* _**Cropping**_\n* _**Adding Images -Stickers-**_\n* _**Adding Text with Colors**_\n* _**Drawing with Colors**_\n* _**Scaling and Rotating Objects**_\n* _**Deleting Objects**_\n* _**Saving to Photos and Sharing**_\n* _**Cool Animations**_\n\n\u003cimg src=\"assets/hero.gif\" /\u003e\n\n## 📖 Getting started\n\n`$ yarn add react-native-photo-editor`\n\n\u003e This library is supported React Native V61 and above\n\n- **iOS**\n\n\u003e **iOS Prerequisite:** Please make sure `CocoaPods` is installed on your system\n\n\t- Add the following to your `Podfile` -\u003e `ios/Podfile` and run pod update:\n\n```\n  use_native_modules!\n\n  pod 'RNPhotoEditor', :path =\u003e '../node_modules/react-native-photo-editor/ios'\n\n  use_frameworks! :linkage =\u003e :static\n\n  pod 'iOSPhotoEditor', :git =\u003e 'https://github.com/prscX/photo-editor', :branch =\u003e 'master'\n\n  post_install do |installer|\n    installer.pods_project.targets.each do |target|\n      if target.name.include?('iOSPhotoEditor')\n        target.build_configurations.each do |config|\n          config.build_settings['SWIFT_VERSION'] = '5'\n        end\n      end\n    end\n  end\n\n  # Follow [Flipper iOS Setup Guidelines](https://fbflipper.com/docs/getting-started/ios-native)\n  # This is required because iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile\n  $static_framework = ['FlipperKit', 'Flipper', 'Flipper-Folly',\n    'CocoaAsyncSocket', 'ComponentKit', 'Flipper-DoubleConversion',\n    'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket', 'Yoga', 'YogaKit',\n    'CocoaLibEvent', 'OpenSSL-Universal', 'boost-for-react-native']\n  \n  pre_install do |installer|\n    Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}\n    installer.pod_targets.each do |pod|\n        if $static_framework.include?(pod.name)\n          def pod.build_type;\n            Pod::BuildType.static_library\n          end\n        end\n      end\n  end\n\n```\n\n  - Please make sure [**Flipper iOS Setup Guidelines**](https://fbflipper.com/docs/getting-started/ios-native/) steps are added to Podfile, since iOSPhotoEditor is implemented using Swift and we have to use use_frameworks! in Podfile\n\n  - If using React Native Firebase v6+, please see `Troubleshooting` section for a known issue before moving further.\n\n  - Add below property to your info.list\n\n```\n\t\u003ckey\u003eNSPhotoLibraryAddUsageDescription\u003c/key\u003e\n\t\u003cstring\u003eApplication needs permission to write photos...\u003c/string\u003e\n\n\t\u003c!-- If you are targeting devices running on iOS 10 or later, you'll also need to add: --\u003e\n\t\u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n\t\u003cstring\u003eiOS 10 needs permission to write photos...\u003c/string\u003e\n```\n\n- **Android**\n\n- Please add below script in your build.gradle\n\n```\nbuildscript {\n    repositories {\n        maven { url \"https://jitpack.io\" }\n        ...\n    }\n}\n\nallprojects {\n    repositories {\n        maven { url \"https://jitpack.io\" }\n        ...\n    }\n}\n```\n\n\n- Add below activity in your app activities:\n\n`\n\u003cactivity android:name=\"com.ahmedadeltito.photoeditor.PhotoEditorActivity\" /\u003e\n\u003cactivity android:name=\"com.yalantis.ucrop.UCropActivity\" /\u003e\n`\n\n- To save image to the public external storage, you must request the WRITE_EXTERNAL_STORAGE permission in your manifest file:\n\n`\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e`\n\n## ⛄️ Stickers\n\nIf you want stickers, please add them to your native project:\n\n* **iOS:** Add stickers to iOS Resources folder\n* **Android:** Add stickers to app `drawable` folder\n\n\u003e Refer Example project for the same.\n\n## 💻 Usage\n\n```\nimport PhotoEditor from 'react-native-photo-editor'\n\nPhotoEditor.Edit({\n    path: RNFS.DocumentDirectoryPath + \"/photo.jpg\"\n});\n```\n\n\u003e * Purpose of this library is to edit photos which are within app sandbox, we recommend to move captured image to app sandbox then using RNFS share image path with library for the edit.\n\n\u003e * Example: If we capture image through cameraRoll then we should first move image to app sandbox using RNFS then share app storage path with the editor.\n\n## 💡 Props\n\n- **General(iOS \u0026 Android)**\n\n| Prop                   | Type                | Default | Note                                             |\n| ---------------------- | ------------------- | ------- | ------------------------------------------------ |\n| `path: mandatory`     | `string`            |         | Specify image path you want to edit                 |\n| `hiddenControls`                | `array`            |         | Specify editor controls you want to hide `[clear, crop, draw, save, share, sticker, text]`                        |\n| `stickers`          | `array`            |         | Specify stickers you want to show in stickers picker                  |\n| `colors`     | `array: HEX-COLOR` |    `[#000000, #808080, #a9a9a9, #FFFFFF, #0000ff, #00ff00, #ff0000, #ffff00, #ffa500, #800080, #00ffff, #a52a2a, #ff00ff]`     | Specify colors you want to show for draw/text              |\n| `onDone`    | `func` |         | Specify done callback            |\n| `onCancel`        | `func`            |      | Specify cancel callback       |\n\n## 🔧 Troubleshooting\n### If using React Native Firebase v6+ or facing any of the following issues: [#104](https://github.com/prscX/react-native-photo-editor/issues/104), [#93](https://github.com/prscX/react-native-photo-editor/issues/93)\n  - Add the following to your `podfile -\u003e ios/podfile` and run `pod install`\n```\npre_install do |installer|\n  installer.pod_targets.each do |pod|\n    if pod.name.start_with?('RNFB')\n      def pod.build_type;\n        Pod::BuildType.static_library\n      end\n    end\n  end\nend\n```\n\n  - If the above doesn't work, try the following and and re-run `pod install`:\n\nAs [@react-native-firebase documentation](https://rnfirebase.io/#allow-ios-static-frameworks) you should add following to top of the Podfile for Allow iOS Static Frameworks\n```\n$RNFirebaseAsStaticFramework = true\n```\n\n### [__swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers / __swift_FORCE_LOAD_$_swiftCoreMIDI](https://github.com/prscX/react-native-photo-editor/issues/171)\n\n## ✨ Credits\n\n- Android Photo Editor: [eventtus/photo-editor-android](https://github.com/eventtus/photo-editor-android)\n- iOS Photo Editor: [eventtus/photo-editor](https://github.com/eventtus/photo-editor)\n\n## 🤔 How to contribute\nHave an idea? Found a bug? Please raise to [ISSUES](https://github.com/prscX/react-native-photo-editor/issues).\nContributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.\n\n## 💫 Where is this library used?\nIf you are using this library in one of your projects, add it in this list below. ✨\n\n\n## 📜 License\nThis library is provided under the Apache 2 License.\n\nRNPhotoEditor @ [prscX](https://github.com/prscX)\n\n## 💖 Support my projects\nI open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).\n\nHowever, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:\n* Starring and sharing the projects you like 🚀\n* If you're feeling especially charitable, please follow [prscX](https://github.com/prscX) on GitHub.\n\n  \u003ca href=\"https://www.buymeacoffee.com/prscX\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n\n  Thanks! ❤️\n  \u003cbr/\u003e\n  [prscX.github.io](https://prscx.github.io)\n  \u003cbr/\u003e\n  \u003c/ Pranav \u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FprscX%2Freact-native-photo-editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FprscX%2Freact-native-photo-editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FprscX%2Freact-native-photo-editor/lists"}