{"id":21130075,"url":"https://github.com/biokys/cropimage","last_synced_at":"2025-07-09T01:32:15.599Z","repository":{"id":53715922,"uuid":"2131933","full_name":"biokys/cropimage","owner":"biokys","description":"Replacement for deprecated official Android crop image function","archived":false,"fork":false,"pushed_at":"2017-02-17T19:26:57.000Z","size":102,"stargazers_count":556,"open_issues_count":50,"forks_count":298,"subscribers_count":54,"default_branch":"master","last_synced_at":"2023-11-07T17:14:53.349Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/biokys.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}},"created_at":"2011-07-31T10:20:10.000Z","updated_at":"2023-11-03T06:11:55.000Z","dependencies_parsed_at":"2022-08-26T14:23:03.188Z","dependency_job_id":null,"html_url":"https://github.com/biokys/cropimage","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biokys%2Fcropimage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biokys%2Fcropimage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biokys%2Fcropimage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biokys%2Fcropimage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biokys","download_url":"https://codeload.github.com/biokys/cropimage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476376,"owners_count":17480215,"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":"2024-11-20T05:32:15.107Z","updated_at":"2024-11-20T05:32:20.356Z","avatar_url":"https://github.com/biokys.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"The MIT License (MIT)\n\nCopyright (c) 2012 Jan Muller\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies 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, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nCropimage\n=========\n\n- Added support for building with Gradle\n- Replacement for deprecated official Android crop image function\n- \u003e 2.2 API\n- Easy to integrate to your app.\n- Enjoy ;-)\n\n\nCall this method to run CropImage activity\n```java\nprivate void runCropImage() {\n\n    // create explicit intent\n    Intent intent = new Intent(this, CropImage.class);\n    \n    // tell CropImage activity to look for image to crop \n    String filePath = ...;\n    intent.putExtra(CropImage.IMAGE_PATH, filePath);\n    \n    // allow CropImage activity to rescale image\n    intent.putExtra(CropImage.SCALE, true);\n    \n    // if the aspect ratio is fixed to ratio 3/2\n    intent.putExtra(CropImage.ASPECT_X, 3);\n    intent.putExtra(CropImage.ASPECT_Y, 2);\n    \n    // start activity CropImage with certain request code and listen\n    // for result\n    startActivityForResult(intent, REQUEST_CODE_CROP_IMAGE);\n}\n```\n\nWaiting for result\n```java\n@Override\nprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n    if (resultCode != RESULT_OK) {\n\n        return;\n    }  \n\n    switch (requestCode) {\n\n        case REQUEST_CODE_CROP_IMAGE:\n\n            String path = data.getStringExtra(CropImage.IMAGE_PATH);\n            \n            // if nothing received\n            if (path == null) {\n\n                return;\n            }\n\n            // cropped bitmap\n            Bitmap bitmap = BitmapFactory.decodeFile(mFileTemp.getPath());\n            \n            break;\n    }\n    super.onActivityResult(requestCode, resultCode, data);\n}\n```\n\nBuilding with Gradle\n--------------------\n\nTo build with gradle, make sure you have installed the gradle wrapper in the top level directory.\nOn my computer this is typically done (from the root of this project) with a:\n\n    cp -Rv /opt/android-studio/sdk/tools/templates/gradle/wrapper/* .\n\nMake sure to adjust the path to whereever you installed Android Studio.\n\nAfter doing this, to build issue the following command (again from the root of this project):\n\n    ./gradlew assembleDebug\n\nTo install the example a running emulator or device, do a:\n\n    adb install -r ./simple-crop-image-example/build/apk/simple-crop-image-example-debug-unaligned.apk\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiokys%2Fcropimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiokys%2Fcropimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiokys%2Fcropimage/lists"}