{"id":13644053,"url":"https://github.com/Jhuster/ImageCropper","last_synced_at":"2025-04-21T06:32:52.666Z","repository":{"id":25621970,"uuid":"29057188","full_name":"Jhuster/ImageCropper","owner":"Jhuster","description":"A custom image cropper library on Android.  ","archived":false,"fork":false,"pushed_at":"2017-05-07T02:14:29.000Z","size":1497,"stargazers_count":147,"open_issues_count":1,"forks_count":32,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-09T16:43:44.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://ticktick.blog.51cto.com/823160/1601702","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/Jhuster.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}},"created_at":"2015-01-10T12:56:11.000Z","updated_at":"2023-10-26T22:54:43.000Z","dependencies_parsed_at":"2022-08-24T14:09:42.011Z","dependency_job_id":null,"html_url":"https://github.com/Jhuster/ImageCropper","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jhuster%2FImageCropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jhuster%2FImageCropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jhuster%2FImageCropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jhuster%2FImageCropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jhuster","download_url":"https://codeload.github.com/Jhuster/ImageCropper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250008278,"owners_count":21359957,"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-08-02T01:01:56.908Z","updated_at":"2025-04-21T06:32:47.656Z","avatar_url":"https://github.com/Jhuster.png","language":"Java","readme":"ImageCropper\n=========\nA custom image cropper library on Android\n\nFeatures\n=========\n- Support moving/scale the crop window freely by finger\n- Support set a fixed crop window size\n- Support set the max crop window size\n- Support set a fixed crop window's width/height aspect\n- Support rotate the image when cropping\n- Easy to integrate into your app\n\nScreenShot\n=========\n\u003cimg src=\"ImageCropper.jpg\" width=\"800\" height=\"1280\" /\u003e\n\nDependency \n=========\n(1) Add it in your root build.gradle at the end of repositories:\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url \"https://jitpack.io\" }\n    }\n}\n```\n\n(2) Add the dependency\n```groovy\nallprojects {\n    compile 'com.github.Jhuster:ImageCropper:v1.1.1'\n}\n```\n\nUsage\n=========\nDeclare the CropImageActivity in the main project's AndroidManifest.xml\n```xml\n\u003cactivity android:name=\"com.jhuster.imagecropper.CropImageActivity\"/\u003e\n```\n\nDeclare the write_external_storage permission in the main project's AndroidManifest.xml\n```xml\n\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n```\n\nCall these methods to run CropImage Activity\n\n```java\n//1. Using the CropIntent to help build the start intent\nprivate void startCropImage() {\n\n    // Create a CropIntent\n    CropIntent intent = new CropIntent();\n\n    // Set the source image filepath/URL and output filepath/URL (Optional)\n    //intent.setImagePath(\"/sdcard/source.jpg\");\n    intent.setOutputPath(\"/sdcard/cropped.jpg\");\n\n    // Set a fixed crop window size (Optional)\n    //intent.setOutputSize(640,480);\n\n    // set the max crop window size (Optional)\n    //intent.setMaxOutputSize(800,600);\n\n    // Set a fixed crop window's width/height aspect (Optional)\n    //intent.setAspect(3,2);\n\n    // start ImageCropper activity with certain request code and listen for result\n    startActivityForResult(intent.getIntent(this), 0);\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        return;\n    }\n\n    if (requestCode == 0) {\n        Uri croppedUri = data.getExtras().getParcelable(MediaStore.EXTRA_OUTPUT);\n        InputStream in = null;\n        try {\n            in = getContentResolver().openInputStream(croppedUri);\n            Bitmap b = BitmapFactory.decodeStream(in);\n            //mImageView.setImageBitmap(b);\n        }\n        catch (FileNotFoundException e) {\n            e.printStackTrace();\n        }\n    }\n    super.onActivityResult(requestCode, resultCode, data);\n}\n```\n\nContact\n----------\nEmail：lujun.hust@gmail.com\n\n\n","funding_links":[],"categories":["图片"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJhuster%2FImageCropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJhuster%2FImageCropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJhuster%2FImageCropper/lists"}