{"id":13644047,"url":"https://github.com/mikekpl/croperino","last_synced_at":"2025-04-21T06:32:50.504Z","repository":{"id":47327669,"uuid":"68277573","full_name":"mikekpl/croperino","owner":"mikekpl","description":"📷 Simple image cropping tool after picking an image in gallery or after snapping a photo in your camera","archived":false,"fork":false,"pushed_at":"2023-11-06T02:38:40.000Z","size":313,"stargazers_count":179,"open_issues_count":7,"forks_count":61,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-04T00:06:49.005Z","etag":null,"topics":["android","aspect-ratio","camera","crop","croperino","gallery","image","kotlin","photo","rotate","zoom"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikekpl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-09-15T08:20:38.000Z","updated_at":"2023-12-12T07:06:06.000Z","dependencies_parsed_at":"2023-11-06T03:29:44.591Z","dependency_job_id":"0b6a1e0d-1bb6-4189-963a-e5f0016195c8","html_url":"https://github.com/mikekpl/croperino","commit_stats":null,"previous_names":["mikekpl/croperino","mike14u/croperino","ekimual/croperino"],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekpl%2Fcroperino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekpl%2Fcroperino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekpl%2Fcroperino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekpl%2Fcroperino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikekpl","download_url":"https://codeload.github.com/mikekpl/croperino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250008275,"owners_count":21359956,"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","aspect-ratio","camera","crop","croperino","gallery","image","kotlin","photo","rotate","zoom"],"created_at":"2024-08-02T01:01:56.856Z","updated_at":"2025-04-21T06:32:45.481Z","avatar_url":"https://github.com/mikekpl.png","language":"Kotlin","funding_links":[],"categories":["图片"],"sub_categories":[],"readme":"# Croperino\n\n\u003e A simple image cropping tool for your android applications (v2.0.0)\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Croperino-blue.svg?style=popout-square)](https://android-arsenal.com/details/1/4374)\n\nSupported SDK and Gradle Version:\n* Minimum SDK Version 24\n* Gradle 8.4\n\nFeatures:\n* Camera and/or gallery calls.\n* Face recognition\n* Cropping of Image based on Scale (Aspect Ratio)\n* Customizing button and background\n* Performance and compression improvements\n* Removed permission support (still has issues and different per Device OS)\n* Chooser capability is no longer recommended\n\n\u003cimg src=\"https://user-images.githubusercontent.com/16832215/36243160-2477012a-125b-11e8-9daf-3eb734e401d0.png\" width=\"200\" height=\"400\"\u003e\n\n## Getting Started\n\nMake sure to have Android Studio\n\n**Gradle**\n\nIn your root build.gradle, add at the end of the repositories:\n\n```\nallprojects {\n  repositories {\n    ...\n    maven { url 'https://jitpack.io' }\n  }\n}\n```\n\nIf you are using newer Android Studio Project structure that is using build.gradle.kts, you can instead declare inside your settings.gradle.kts:\n\n```\ndependencyResolutionManagement {\n  repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n      google()\n      mavenCentral()\n      maven (url = \"https://jitpack.io\")\n    }\n}\n```\n\nAdd the dependency\n\n```\nimplementation 'com.github.mikekpl:croperino:2.0.0'\n```\n\n## Usage\n\n**Permissions**\n\nIMPORTANT!! Please manage permissions accordingly (the library's permission management is bugged at the moment)\n* Camera permission is still being checked, but it would be better if you're able to handle permission prompts\n* Gallery access should have read and write access as well as ACTION_PICK capability\n\n**Sample Usage**\n\nInitialization:\n```\nCroperinoConfig(\"IMG_\" + System.currentTimeMillis() + \".jpg\", \"/MikeLau/Pictures\", \"/sdcard/MikeLau/Pictures\")\nCroperinoFileUtil.setupDirectory(this)\n```\n\nMake sure corresponding permissions are already granted prior to calling these functions:\n```\n// Prepare Camera - Make sure Camera permission is already allowed otherwise it won't work\nCroperino.prepareCamera(this)\n\n// Prepare Gallery - Make sure Read / Write / Manage External Storage is already allowed otherwise it won't work\nCroperino.prepareGallery(this)\n```\n\n**onActivityResult**\n\n- Aspect Ratio X = 1 / Y = 1 will produce fixed square view\n- Aspect Ratio X = 0 / Y = 0 will produce customizable square view width or height can be customized\n- Color and Background Color should be XML format e.g. R.color.gray, place 0 if no change is meant to colors\n\n```\n@Override\npublic void onActivityResult(int requestCode, int resultCode, Intent data) {\n    super.onActivityResult(requestCode, resultCode, data);\n\n    switch (requestCode) {\n        case CroperinoConfig.REQUEST_TAKE_PHOTO:\n            if (resultCode == Activity.RESULT_OK) {\n                /* Parameters of runCropImage = File, Activity Context, Image is Scalable or Not, Aspect Ratio X, Aspect Ratio Y, Button Bar Color, Background Color */\n                Croperino.runCropImage(CroperinoFileUtil.getTempFile(), MainActivity.this, true, 1, 1, R.color.gray, R.color.gray_variant);\n            }\n            break;\n        case CroperinoConfig.REQUEST_PICK_FILE:\n            if (resultCode == Activity.RESULT_OK) {\n                CroperinoFileUtil.newGalleryFile(data, MainActivity.this);\n                Croperino.runCropImage(CroperinoFileUtil.getTempFile(), MainActivity.this, true, 0, 0, R.color.gray, R.color.gray_variant);\n            }\n            break;\n        case CroperinoConfig.REQUEST_CROP_PHOTO:\n            if (resultCode == Activity.RESULT_OK) {\n                Uri i = Uri.fromFile(CroperinoFileUtil.getTempFile());\n                ivMain.setImageURI(i);\n                //Do saving / uploading of photo method here.\n                //The image file can always be retrieved via CroperinoFileUtil.getTempFile()\n            }\n            break;\n        default:\n            break;\n    }\n}\n```\n\n**Proguard**\n\n```\n-dontwarn com.mikelau.croperino.**\n-keep class com.mikelau.croperino.** { *; }\n-keep interface com.mikelau.croperino.** { *; }\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/mikekpl/croperino/fork\u003e)\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Commit your changes (`git commit -am 'Add some fooBar'`)\n4. Push to the branch (`git push origin feature/fooBar`)\n5. Create a new Pull Request\n\n## License\n\n```\nThe MIT License (MIT)\n\nCopyright (c) 2013 Mike Lau\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikekpl%2Fcroperino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikekpl%2Fcroperino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikekpl%2Fcroperino/lists"}