{"id":13492621,"url":"https://github.com/ArthurHub/Android-Image-Cropper","last_synced_at":"2025-03-28T10:32:45.226Z","repository":{"id":25853283,"uuid":"29293002","full_name":"ArthurHub/Android-Image-Cropper","owner":"ArthurHub","description":"Image Cropping Library for Android, optimized for Camera / Gallery.","archived":false,"fork":false,"pushed_at":"2023-09-17T15:20:18.000Z","size":26047,"stargazers_count":6423,"open_issues_count":363,"forks_count":1383,"subscribers_count":175,"default_branch":"master","last_synced_at":"2025-03-20T07:03:49.579Z","etag":null,"topics":["android","android-image-cropper","cropper"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Quick/Nimble","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ArthurHub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-01-15T10:49:37.000Z","updated_at":"2025-03-16T03:55:16.000Z","dependencies_parsed_at":"2023-10-20T17:45:37.932Z","dependency_job_id":null,"html_url":"https://github.com/ArthurHub/Android-Image-Cropper","commit_stats":{"total_commits":490,"total_committers":63,"mean_commits":7.777777777777778,"dds":0.5285714285714286,"last_synced_commit":"2a4a425668bfff1329dd5bfb1b80b0829bb4cc67"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurHub%2FAndroid-Image-Cropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurHub%2FAndroid-Image-Cropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurHub%2FAndroid-Image-Cropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArthurHub%2FAndroid-Image-Cropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArthurHub","download_url":"https://codeload.github.com/ArthurHub/Android-Image-Cropper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245814674,"owners_count":20676807,"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","android-image-cropper","cropper"],"created_at":"2024-07-31T19:01:07.600Z","updated_at":"2025-03-28T10:32:45.203Z","avatar_url":"https://github.com/ArthurHub.png","language":"Java","readme":"Android Image Cropper\n=======\n\n# :triangular_flag_on_post: The Project is NOT currently maintained :triangular_flag_on_post:\n\n## Please use **[CanHub's fork](https://github.com/CanHub/Android-Image-Cropper)!**\n\n### Thank everybody for using the library. It was very fun to create and a privilage to help you build awesome apps.\n### The same way I took an unmaintained initial implementation from [edmodo](https://github.com/edmodo/cropper), I'm happy to see [CanHub](https://github.com/CanHub/Android-Image-Cropper) taking it now.\n### Good luck and happy coding :octocat:\n\n\n----\n----\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android--Image--Cropper-green.svg?style=true)](https://android-arsenal.com/details/1/3487)\n[![Build Status](https://travis-ci.org/ArthurHub/Android-Image-Cropper.svg?branch=master)](https://travis-ci.org/ArthurHub/Android-Image-Cropper)\n\n**Powerful** (Zoom, Rotation, Multi-Source), **customizable** (Shape, Limits, Style), **optimized** (Async, Sampling, Matrix) and **simple** image cropping library for Android.\n\n![Crop](https://github.com/ArthurHub/Android-Image-Cropper/blob/master/art/demo.gif?raw=true)\n\n## Usage\n*For a working implementation, please have a look at the Sample Project*\n\n[See GitHub Wiki for more info.](https://github.com/ArthurHub/Android-Image-Cropper/wiki)\n\n1. Include the library\n\n ```\n dependencies {\n     api 'com.theartofdev.edmodo:android-image-cropper:2.8.+'\n }\n ```\n\nAdd permissions to manifest\n\n ```\n \u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/\u003e\n \u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/\u003e\n ```\nAdd this line to your Proguard config file\n\n```\n-keep class androidx.appcompat.widget.** { *; }\n```\n### Using Activity\n\n2. Add `CropImageActivity` into your AndroidManifest.xml\n ```xml\n \u003cactivity android:name=\"com.theartofdev.edmodo.cropper.CropImageActivity\"\n   android:theme=\"@style/Base.Theme.AppCompat\"/\u003e \u003c!-- optional (needed if default theme has no action bar) --\u003e\n ```\n\n3. Start `CropImageActivity` using builder pattern from your activity\n ```java\n // start picker to get image for cropping and then use the image in cropping activity\n CropImage.activity()\n   .setGuidelines(CropImageView.Guidelines.ON)\n   .start(this);\n\n // start cropping activity for pre-acquired image saved on the device\n CropImage.activity(imageUri)\n  .start(this);\n\n // for fragment (DO NOT use `getActivity()`)\n CropImage.activity()\n   .start(getContext(), this);\n ```\n\n4. Override `onActivityResult` method in your activity to get crop result\n ```java\n @Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n   if (requestCode == CropImage.CROP_IMAGE_ACTIVITY_REQUEST_CODE) {\n     CropImage.ActivityResult result = CropImage.getActivityResult(data);\n     if (resultCode == RESULT_OK) {\n       Uri resultUri = result.getUri();\n     } else if (resultCode == CropImage.CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE) {\n       Exception error = result.getError();\n     }\n   }\n }\n ```\n\n### Using View\n2. Add `CropImageView` into your activity\n ```xml\n \u003c!-- Image Cropper fill the remaining available height --\u003e\n \u003ccom.theartofdev.edmodo.cropper.CropImageView\n   xmlns:custom=\"http://schemas.android.com/apk/res-auto\"\n   android:id=\"@+id/cropImageView\"\n   android:layout_width=\"match_parent\"\n   android:layout_height=\"0dp\"\n   android:layout_weight=\"1\"/\u003e\n ```\n\n3. Set image to crop\n ```java\n cropImageView.setImageUriAsync(uri);\n // or (prefer using uri for performance and better user experience)\n cropImageView.setImageBitmap(bitmap);\n ```\n\n4. Get cropped image\n ```java\n // subscribe to async event using cropImageView.setOnCropImageCompleteListener(listener)\n cropImageView.getCroppedImageAsync();\n // or\n Bitmap cropped = cropImageView.getCroppedImage();\n ```\n\n## Features\n- Built-in `CropImageActivity`.\n- Set cropping image as Bitmap, Resource or Android URI (Gallery, Camera, Dropbox, etc.).\n- Image rotation/flipping during cropping.\n- Auto zoom-in/out to relevant cropping area.\n- Auto rotate bitmap by image Exif data.\n- Set result image min/max limits in pixels.\n- Set initial crop window size/location.\n- Request cropped image resize to specific size.\n- Bitmap memory optimization, OOM handling (should never occur)!\n- API Level 14.\n- More..\n \n## Customizations\n- Cropping window shape: Rectangular or Oval (cube/circle by fixing aspect ratio).\n- Cropping window aspect ratio: Free, 1:1, 4:3, 16:9 or Custom.\n- Guidelines appearance: Off / Always On / Show on Toch.\n- Cropping window Border line, border corner and guidelines thickness and color.\n- Cropping background color.\n\nFor more information, see the [GitHub Wiki](https://github.com/ArthurHub/Android-Image-Cropper/wiki). \n\n## Posts\n - [Android cropping image from camera or gallery](http://theartofdev.com/2015/02/15/android-cropping-image-from-camera-or-gallery/)\n - [Android Image Cropper async support and custom progress UI](http://theartofdev.com/2016/01/15/android-image-cropper-async-support-and-custom-progress-ui/)\n - [Adding auto-zoom feature to Android-Image-Cropper](https://theartofdev.com/2016/04/25/adding-auto-zoom-feature-to-android-image-cropper/)\n\n## Change log\n*2.8.0*\n- Fix crash on Android O (thx @juliooa)\n- Update to support library to AndroidX (thx @mradzinski)\n- Handle failure when selecting non image file (thx @uncledoc)\n- More translations (thx @jkwiecien, @david-serrano)\n\n*2.7.0*\n- Update gradle wrapper to 4.4\n- Update support library to 27.1.1 and set is statically! (thx @androideveloper)\n- Fix NPE in activity creation by tools (thx @unverbraucht)\n- More translations (thx @gwharvey, @dlackty, @JairoGeek, @shaymargolis)\n\nSee [full change log](https://github.com/ArthurHub/Android-Image-Cropper/wiki/Change-Log).\n\n## License\nOriginally forked from [edmodo/cropper](https://github.com/edmodo/cropper).\n\nCopyright 2016, Arthur Teplitzki, 2013, Edmodo, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this work except in compliance with the   License.\nYou may obtain a copy of the License in the LICENSE file, or at:\n\n  http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS   IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","funding_links":[],"categories":["Java","图片","cropper"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArthurHub%2FAndroid-Image-Cropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FArthurHub%2FAndroid-Image-Cropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FArthurHub%2FAndroid-Image-Cropper/lists"}