{"id":21174831,"url":"https://github.com/mindinventory/image_cropping","last_synced_at":"2025-10-20T01:55:08.680Z","repository":{"id":38258048,"uuid":"384402350","full_name":"Mindinventory/image_cropping","owner":"Mindinventory","description":"Crop and Rotate Images using this Flutter plugin","archived":false,"fork":false,"pushed_at":"2025-01-01T05:40:11.000Z","size":16461,"stargazers_count":44,"open_issues_count":1,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T06:07:56.473Z","etag":null,"topics":["android","dart","flutter","flutter-plugin","image-cropper","ios"],"latest_commit_sha":null,"homepage":"https://www.mindinventory.com/flutter-app-development.php","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mindinventory.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-09T10:27:51.000Z","updated_at":"2024-12-31T05:45:48.000Z","dependencies_parsed_at":"2025-02-14T15:23:43.103Z","dependency_job_id":null,"html_url":"https://github.com/Mindinventory/image_cropping","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mindinventory%2Fimage_cropping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mindinventory%2Fimage_cropping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mindinventory%2Fimage_cropping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mindinventory%2Fimage_cropping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mindinventory","download_url":"https://codeload.github.com/Mindinventory/image_cropping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999864,"owners_count":21031046,"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","dart","flutter","flutter-plugin","image-cropper","ios"],"created_at":"2024-11-20T16:56:22.389Z","updated_at":"2025-10-20T01:55:08.568Z","avatar_url":"https://github.com/Mindinventory.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# image_cropping\n\n\n\u003ca href=\"https://pub.dev/packages/image_cropping\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/image_cropping.svg?label=image_cropping\" alt=\"image_cropping version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/Mindinventory/image_cropping\"\u003e\u003cimg src=\"https://img.shields.io/github/stars/Mindinventory/image_cropping?style=social\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\u003ca href=\"https://developer.android.com\" style=\"pointer-events: stroke;\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-android-blue\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://developer.apple.com/ios/\" style=\"pointer-events: stroke;\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-iOS-blue\"\u003e\n\u003c/a\u003e\n\u003ca href=\"\" style=\"pointer-events: stroke;\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-Linux-blue\"\u003e\n\u003c/a\u003e\n\u003ca href=\"\" style=\"pointer-events: stroke;\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-Mac-blue\"\u003e\n\u003c/a\u003e\n\u003ca href=\"\" style=\"pointer-events: stroke;\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-web-blue\"\u003e\n\u003c/a\u003e\n\u003ca href=\"\" style=\"pointer-events: stroke;\" target=\"_blank\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-Windows-blue\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-purple.svg\" alt=\"MIT License\"\u003e\u003c/a\u003e\n\nThis plugin supports cropping and rotating images for multiplatform. It Allow inclusion of background, Rotation of image, changing ratio of selection as per requirements.\n\n\n### Allow inclusion of background.\n![Image Plugin](https://github.com/Mindinventory/image_cropping/blob/master/assets/image_plugin_1.gif?raw=true)\n\n### Rotation of image.\n![Image Plugin](https://github.com/Mindinventory/image_cropping/blob/master/assets/image_plugin_2.gif?raw=true)\n\n### Change ratio of selection.\n![Image Plugin](https://github.com/Mindinventory/image_cropping/blob/master/assets/image_plugin_3.gif?raw=true)\n\n## Installation\nIf you are targeting web, don't forget to add worker.js in your project's root directory.\n\nYou can also add worker.js.deps and worker.js.map but they are optional and only used for development.\n\nThese 3 files are generated when running the following command in the example folder:\n``` bash\ndart compile js -O1 -o web/worker.js lib/worker.dart\n```\nFor more details on the command, check [this link](https://dart.dev/tools/dart2js).\nIt converts the dart code to JS, which will then be run in a web worker.\n\n### Example\n``` dart\nfinal croppedBytes = await ImageCropping.cropImage(\n    context: context,\n    imageBytes: bytes,\n    onImageStartLoading: () {\n        showLoader();\n    },\n    onImageEndLoading: () {\n        hideLoader();\n    },\n    onImageDoneListener: (data) {\n        // You can also use a listener instead of awaiting the function\n        setState(() {\n          imageBytes = data;\n        });\n    },\n    selectedImageRatio: ImageRatio.RATIO_1_1,\n    visibleOtherAspectRatios: true,\n    squareBorderWidth: 2,\n    squareCircleColor: Colors.black,\n    defaultTextColor: Colors.orange,\n    selectedTextColor: Colors.black,\n    colorForWhiteSpace: Colors.grey,\n    encodingQuality: 80,\n    outputImageFormat: OutputImageFormat.jpg, \n    workerPath: 'crop_worker.js',\n);\n```\n\n### Required parameters\n\n##### BuildContext:\nContext is use to push new screen for image cropping.\n\n##### _imageBytes:\nImage bytes is use to draw image in device and if image not fits in device screen then we manage background color(if you have passed colorForWhiteSpace or else White background) in image cropping screen.\n\n##### _onImageStartLoading:\nThis is a callback. you have to override and show dialog or etc when image cropping is in loading state.\n\n##### _onImageEndLoading:\nThis is a callback. you have to override and hide dialog or etc when image cropping is ready to show result in cropping screen.\n\n##### _onImageDoneListener:\nThis is a callback. you have to override and you will get Uint8List as result.\n\n## Optional parameters\n\n##### ImageRatio:\nThis property contains ImageRatio value. You can set the initialized aspect ratio when starting the cropper by passing a value of ImageRatio. default value is `ImageRatio.FREE`\n\n##### visibleOtherAspectRatios:\nThis property contains boolean value. If this properties is true then it shows all other aspect ratios in cropping screen. default value is `true`.\n\n##### squareBorderWidth:\nThis property contains double value. You can change square border width by passing this value.\n\n##### squareCircleColor:\nThis property contains Color value. You can change square circle color by passing this value.\n\n#####  defaultTextColor:\nThis property contains Color value. By passing this property you can set aspect ratios color which are unselected.\n\n##### selectedTextColor:\nThis property contains Color value. By passing this property you can set aspect ratios color which is selected.\n\n##### colorForWhiteSpace:\nThis property contains Color value. By passing this property you can set background color, if screen contains blank space.\n\n##### encodingQuality\nSet the encodingQuality of the cropped image. Defaults to 100 (max).\nHigh quality involves bigger image file size.\n\n#### outputImageFormat\nOutput format of cropped image, can be PNG or JPG, default is JPG.\n\n##### workerPath\nYou may want to change the worker.js name, especially if you use other web workers and you already have a worker.js file.\nDefaults to 'worker.js'.\n\n## Note:\nFor flutter web, copy worker.js from example folder to the project, else it will not work.\nThe result returns in Uint8List. so it can be lost later, you are responsible for storing it somewhere permanent (if needed).\n\n## Guideline for contributors\nContribution towards our repository is always welcome, we request contributors to create a pull request to the develop branch only.\n\n## Guideline to report an issue/feature request\nIt would be great for us if the reporter can share the below things to understand the root cause of the issue.\n- Library version\n- Code snippet\n- Logs if applicable\n- Device specification like (Manufacturer, OS version, etc)\n- Screenshot/video with steps to reproduce the issue\n\n## Library used\n- [Image](https://pub.dev/packages/image \"Image\")\n\n# LICENSE!\nImage Cropper is [MIT-licensed](https://github.com/Mindinventory/image_cropping/blob/master/LICENSE \"MIT-licensed\").\n\n# Let us know!\nWe’d be really happy if you send us links to your projects where you use our component. Just send an email to sales@mindinventory.com And do let us know if you have any questions or suggestion regarding our work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindinventory%2Fimage_cropping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmindinventory%2Fimage_cropping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmindinventory%2Fimage_cropping/lists"}