{"id":18931027,"url":"https://github.com/nanxiaobei/antd-img-crop","last_synced_at":"2025-10-06T03:12:35.937Z","repository":{"id":40603079,"uuid":"159309681","full_name":"nanxiaobei/antd-img-crop","owner":"nanxiaobei","description":"🗡 An image cropper for Ant Design Upload","archived":false,"fork":false,"pushed_at":"2025-04-29T20:07:49.000Z","size":1914,"stargazers_count":536,"open_issues_count":4,"forks_count":163,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-10T10:41:26.975Z","etag":null,"topics":["ant-design","antd","crop-area","image","image-cropper","react","upload"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/nanxiaobei.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-27T09:27:53.000Z","updated_at":"2025-09-10T09:23:10.000Z","dependencies_parsed_at":"2023-02-15T06:20:24.503Z","dependency_job_id":"e0b7f718-f311-4365-a315-4cecf7026c4a","html_url":"https://github.com/nanxiaobei/antd-img-crop","commit_stats":{"total_commits":509,"total_committers":24,"mean_commits":"21.208333333333332","dds":0.08055009823182713,"last_synced_commit":"476da790f817e9ea0bf974a9bf624c38e402ab5d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nanxiaobei/antd-img-crop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxiaobei%2Fantd-img-crop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxiaobei%2Fantd-img-crop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxiaobei%2Fantd-img-crop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxiaobei%2Fantd-img-crop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanxiaobei","download_url":"https://codeload.github.com/nanxiaobei/antd-img-crop/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxiaobei%2Fantd-img-crop/sbom","scorecard":{"id":674192,"data":{"date":"2025-08-11","repo":{"name":"github.com/nanxiaobei/antd-img-crop","commit":"793b058923b45ad4dfa5540bd16a2d24a342f4ad"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-859w-5945-r5v3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T21:01:24.077Z","repository_id":40603079,"created_at":"2025-08-21T21:01:24.077Z","updated_at":"2025-08-21T21:01:24.077Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278551691,"owners_count":26005426,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ant-design","antd","crop-area","image","image-cropper","react","upload"],"created_at":"2024-11-08T11:40:14.396Z","updated_at":"2025-10-06T03:12:35.919Z","avatar_url":"https://github.com/nanxiaobei.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\nLink in bio to **widgets**,\nyour online **home screen**. ➫ [🔗 kee.so](https://kee.so/)\n\n\u003c/div\u003e\n\n---\n\n# antd-img-crop\n\nAn image cropper for Ant Design [Upload](https://ant.design/components/upload/)\n\n[![npm](https://img.shields.io/npm/v/antd-img-crop.svg?style=flat-square)](https://www.npmjs.com/package/antd-img-crop)\n[![npm](https://img.shields.io/npm/dt/antd-img-crop?style=flat-square)](https://www.npmtrends.com/antd-img-crop)\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/antd-img-crop?style=flat-square)](https://bundlephobia.com/result?p=antd-img-crop)\n[![GitHub](https://img.shields.io/github/license/nanxiaobei/antd-img-crop?style=flat-square)](https://github.com/nanxiaobei/antd-img-crop/blob/main/LICENSE)\n[![npm type definitions](https://img.shields.io/npm/types/typescript?style=flat-square)](https://github.com/nanxiaobei/antd-img-crop/blob/main/src/types.ts)\n\nEnglish | [简体中文](./README.zh-CN.md)\n\n## Install\n\n```sh\npnpm add antd-img-crop\n# or\nyarn add antd-img-crop\n# or\nnpm i antd-img-crop\n```\n\n## Usage\n\n```jsx harmony\nimport { Upload } from 'antd';\nimport ImgCrop from 'antd-img-crop';\n\nconst Demo = () =\u003e (\n  \u003cImgCrop\u003e\n    \u003cUpload\u003e+ Add image\u003c/Upload\u003e\n  \u003c/ImgCrop\u003e\n);\n```\n\n[![Edit antd-img-crop](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/antd-img-crop-5x4j3r)\n\n## Props\n\n| Prop           | Type       | Default        | Description                                                                      |\n| -------------- | ---------- | -------------- | -------------------------------------------------------------------------------- |\n| quality        | `number`   | `0.4`          | Cropped image quality, `0` to `1`                                                |\n| fillColor      | `string`   | `'white'`      | Fill color for cropped image                                                     |\n| zoomSlider     | `boolean`  | `true`         | Enable zoom                                                                      |\n| rotationSlider | `boolean`  | `false`        | Enable rotation                                                                  |\n| aspectSlider   | `boolean`  | `false`        | Enable aspect                                                                    |\n| showReset      | `boolean`  | `false`        | Show reset button to reset zoom \u0026 rotation \u0026 aspect                              |\n| resetText      | `string`   | `Reset`        | Reset button text                                                                |\n| aspect         | `number`   | `1 / 1`        | Aspect of crop area , `width / height`                                           |\n| minZoom        | `number`   | `1`            | Minimum zoom                                                                     |\n| maxZoom        | `number`   | `3`            | Maximum zoom                                                                     |\n| minAspect      | `number`   | `0.5`          | Minimum aspect                                                                   |\n| maxAspect      | `number`   | `2`            | Maximum aspect                                                                   |\n| cropShape      | `string`   | `'rect'`       | Shape of crop area, `'rect'` or `'round'`                                        |\n| showGrid       | `boolean`  | `false`        | Show grid of crop area (third-lines)                                             |\n| cropperProps   | `object`   | -              | [react-easy-crop] props (\\* existing props cannot be overridden)                 |\n| modalClassName | `string`   | `''`           | Modal classname                                                                  |\n| modalTitle     | `string`   | `'Edit image'` | Modal title                                                                      |\n| modalWidth     | `number`   | `string`       | Modal width                                                                      |\n| modalOk        | `string`   |                | Ok button text                                                                   |\n| modalCancel    | `string`   |                | Cancel button text                                                               |\n| onModalOk      | `function` | -              | Callback of click ok button                                                      |\n| onModalCancel  | `function` | -              | Callback of click cancel button (or modal mask \u0026 top right \"x\")                  |\n| modalProps     | `object`   |                | [Ant Design Modal] props (\\* existing props cannot be overridden)                |\n| beforeCrop     | `function` | -              | Callback before crop modal, if return `false` or `reject()`, modal will not open |\n\n## FAQ\n\n### `ConfigProvider` not work?\n\nTry to set `libraryDirectory`(`'es'` or `'lib'`) to `babel-plugin-import` config, see which one will work.\n\n```js\nmodule.exports = {\n  plugins: [\n    ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }],\n  ],\n};\n```\n\n### No style? (only `antd\u003c=v4`)\n\nIf you use `antd\u003c=v4` + `babel-plugin-import`, and no `Modal` or `Slider` were imported, please import these styles manually:\n\n```js\nimport 'antd/es/modal/style';\nimport 'antd/es/slider/style';\n```\n\n## License\n\n[MIT License](https://github.com/nanxiaobei/antd-img-crop/blob/main/LICENSE) (c) [nanxiaobei](https://lee.so/)\n\n[react-easy-crop]: https://github.com/ValentinH/react-easy-crop#props\n[Ant Design Modal]: https://ant.design/components/modal#api\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanxiaobei%2Fantd-img-crop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanxiaobei%2Fantd-img-crop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanxiaobei%2Fantd-img-crop/lists"}