{"id":33156874,"url":"https://github.com/bthurlow/nativescript-imagecropper","last_synced_at":"2026-04-16T03:04:14.173Z","repository":{"id":6245692,"uuid":"55008814","full_name":"bthurlow/nativescript-imagecropper","owner":"bthurlow","description":"A nativescript image cropping plugin.","archived":false,"fork":false,"pushed_at":"2023-03-05T12:24:47.000Z","size":6964,"stargazers_count":49,"open_issues_count":32,"forks_count":35,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-02T07:55:11.157Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bthurlow.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}},"created_at":"2016-03-29T20:36:32.000Z","updated_at":"2023-09-19T09:47:31.000Z","dependencies_parsed_at":"2024-06-19T11:31:45.104Z","dependency_job_id":"5da25af5-95d8-4e2d-bfcb-20385a4ea95b","html_url":"https://github.com/bthurlow/nativescript-imagecropper","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/bthurlow/nativescript-imagecropper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthurlow%2Fnativescript-imagecropper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthurlow%2Fnativescript-imagecropper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthurlow%2Fnativescript-imagecropper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthurlow%2Fnativescript-imagecropper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bthurlow","download_url":"https://codeload.github.com/bthurlow/nativescript-imagecropper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthurlow%2Fnativescript-imagecropper/sbom","scorecard":{"id":256746,"data":{"date":"2025-08-11","repo":{"name":"github.com/bthurlow/nativescript-imagecropper","commit":"c69097e31ccb951cd3f619c4080fa2528b30e28a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.8,"checks":[{"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":"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":"Code-Review","score":2,"reason":"Found 7/24 approved changesets -- score normalized to 2","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":"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":"Maintained","score":0,"reason":"0 commit(s) and 0 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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: npmCommand not pinned by hash: publish/pack.sh:10","Info:   0 out of   1 npmCommand dependencies pinned"],"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":"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"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 'master'"],"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 13 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":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-4rq4-32rv-6wp6","Warn: Project is vulnerable to: GHSA-64g7-mvw6-v9qj"],"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-17T09:53:17.623Z","repository_id":6245692,"created_at":"2025-08-17T09:53:17.624Z","updated_at":"2025-08-17T09:53:17.624Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31869052,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"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":[],"created_at":"2025-11-15T20:00:36.804Z","updated_at":"2026-04-16T03:04:14.138Z","avatar_url":"https://github.com/bthurlow.png","language":"TypeScript","readme":"\u003c!--\n@Author: Brian Thurlow \u003cbthurlow\u003e\n@Date:   03/29/2016 03:41:05 PM\n@Last modified by:   MultiShiv19\n@Last modified time: 01/06/2020 10:00:19 AM\n--\u003e\n\n# A {N} Image Cropping Plugin\n\n[![License](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)\n[![npm](https://img.shields.io/npm/v/nativescript-imagecropper.svg)](https://www.npmjs.com/package/nativescript-imagecropper) [![npm](https://img.shields.io/npm/dt/nativescript-imagecropper.svg?label=npm%20downloads)](https://www.npmjs.com/package/nativescript-imagecropper) [![GitHub release](https://img.shields.io/github/release/bthurlow/nativescript-imagecropper.svg)](https://github.com/bthurlow/nativescript-imagecropper)\n\n## Notes\n\niOS 8+\n\nAndroid 17+\n\nv2.0.0+ the version of Android Lib has changed and the cropper looks different now,\nhence the breaking change\n\n### Based on\n\n[TOCropViewController](https://github.com/TimOliver/TOCropViewController) for iOS\n\n[uCrop](https://github.com/Yalantis/uCrop) for Android\n\n## Installation\n\n### NativeScript 7+:\nRun `ns plugin add nativescript-imagecropper`\n\n### NativeScript below 7:\nRun `tns plugin add nativescript-imagecropper@3.0.0`\n\n## Screenshots\n\n### Cropper UI \u0026 End result (android)\n\u003cimg src=\"https://github.com/shiv19/nativescript-imagecropper/blob/master/assets/cropperuiandroid.jpeg?raw=true\" height=\"320\" \u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003cimg src=\"https://github.com/shiv19/nativescript-imagecropper/blob/master/assets/cropperresultandroid.jpeg?raw=true\" height=\"320\" \u003e \n\n### Cropper UI (iOS)\n\u003cimg src=\"https://github.com/shiv19/nativescript-imagecropper/blob/master/assets/cropperuiios.png?raw=true\" height=\"320\" \u003e \n\n### Usage (for TS demo, please see the demo folder)\n\nTo use the image cropping module you must first require it.\n\n```js\nvar ImageCropper = require(\"nativescript-imagecropper\").ImageCropper;\n```\n\n### How to get the image source, from nativescript-camera plugin\n```js\nvar camera = require(\"nativescript-camera\");\n\n// You might want to request camera permissions first\n// check demo folder for sample implementation\n\ncamera.takePicture({width:300,height:300,keepAspectRatio:true})\n  .then((imageAsset) =\u003e {\n      let source = new imageSource.ImageSource();\n      source.fromAsset(imageAsset).then((source) =\u003e {\n        // now you have the image source    \n        // pass it to the cropper   \n        // recommend using setTimeout like this\n        setTimeout(() =\u003e {\n          // on iOS we want a timeout of 1second as it takes time before\n          // the imageSource is ready to be read by the plugin\n        }, isAndroid ? 0 : 1000);             \n      });\n  }).catch((err) =\u003e {\n      console.log(\"Error -\u003e \" + err.message);\n  });\n```\n\n### Methods\n\n`show(ImageSource)`: Returns a cropped ImageSource\n\n```js\nvar imageCropper = new ImageCropper();\nimageCropper.show(imageSource).then((args) =\u003e {\n  console.dir(args);\n  if(args.image !== null){\n    imageView.imageSource = args.image;\n  }\n})\n.catch(function(e){\n  console.dir(e);\n});\n```\n\n`show(ImageSource,Options)`: Returns a cropped and resized ImageSource\n\n```js\nvar imageCropper = new ImageCropper();\nimageCropper.show(imageSource,{width:300,height:300}).then((args) =\u003e {\n  console.dir(args);\n  if(args.image !== null){\n    imageView.imageSource = args.image;\n  }\n})\n.catch(function(e){\n  console.dir(e);\n});\n```\n\n### Options\n\nOption | Type   | Description\n------ | ------ | ------------------------------------------------\nwidth  | number | The width of the image you would like returned.\nheight | number | The height of the image you would like returned.\nlockSquare | boolean | Pass this as true, to lock square aspect ratio on iOS, on android, this option doesn't make any difference.\ncircularCrop | boolean | Pass this as true, to crop a circular image on iOS, on android, this options shows a circular mask while cropping, but returns a rectangular image.\n\n### Android Config\n\n```ts\nexport interface OptionsAndroid {\n  isFreeStyleCropEnabled?: boolean; // set to true to let user resize crop bounds (disabled by default)\n  toolbarTitle?: string; // default 'Crop Image'\n  toolbarTextColor?: string; // desired resolved color of Toolbar text and buttons (default is darker orange)\n  toolbarColor?: string; // desired resolved color of the toolbar\n  rootViewBackgroundColor?: string; // desired background color that should be applied to the root view\n  logoColor?: string; // desired resolved color of logo fill (default is darker grey)\n  statusBarColor?: string; // Set statusbar color\n  showCropGrid?: boolean; // set to true if you want to see a crop grid/guidelines on top of an image\n  showCropFrame?: boolean; // set to true if you want to see a crop frame rectangle on top of an image\n  cropFrameStrokeWidth?: number; // desired width of crop frame line in pixels\n  cropGridStrokeWidth?: number; // desired width of crop grid lines in pixels\n  cropGridColor?: string; // desired color of crop grid/guidelines\n  cropFrameColor?: string; // desired color of crop frame\n  cropGridRowCount?: number; // crop grid rows count\n  cropGridColumnCount?: number; // crop grid columns count\n  hideBottomControls?: boolean; // set to true to hide the bottom controls (shown by default)\n  compressionQuality?: number; // Set compression quality [0-100] that will be used to save resulting Bitmap\n  dimmedLayerColor?: string; // desired color of dimmed area around the crop bounds\n  setAspectRatioOptions?: AspectRatioOptions; // Pass an ordered list of desired aspect ratios that should be available for a user.\n  toolbarCropDrawable?: any; // Android Drawable (pass native drawable object ONLY)\n  toolbarCancelDrawable?: any; // Android Drawable (pass native drawable object ONLY)\n}\n\nexport interface AspectRatio {\n  aspectRatioTitle: string,\n  aspectRatioX: number,\n  aspectRatioY: number;\n}\n\nexport interface AspectRatioOptions {\n  defaultIndex: number;\n  aspectRatios: AspectRatio[]\n}\n\n// example aspectRatio options\nsetAspectRatioOptions: {\n    defaultIndex: 0,\n    aspectRatios: [\n        {\n            aspectRatioTitle: '1:1',\n            aspectRatioX: 1,\n            aspectRatioY: 1\n        },\n        {\n            aspectRatioTitle: '16:9',\n            aspectRatioX: 16,\n            aspectRatioY: 9\n        },\n        {\n            aspectRatioTitle: '18:9',\n            aspectRatioX: 18,\n            aspectRatioY: 9\n        }\n    ]\n}\n```\n\n### Additional notes for Android\n\nYou can override library colors just specifying colors with the same names in your colors.xml file.\nFor example:\n\n```xml\n\u003ccolor name=\"ucrop_color_toolbar\"\u003e#000000\u003c/color\u003e\n```\n\nThis will make toolbar color black if specified inside your `App_Resources/Android/values/colors.xml` file.\n\n#### Android styles to customize the cropper activity/styles\n\n``` xml\n   \u003c!--uCrop Activity--\u003e\n    \u003ccolor name=\"ucrop_color_toolbar\"\u003e#FF6E40\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_statusbar\"\u003e#CC5833\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_toolbar_widget\"\u003e#fff\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_widget\"\u003e#000\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_widget_active\"\u003e#FF6E40\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_widget_background\"\u003e#fff\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_widget_text\"\u003e#000\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_progress_wheel_line\"\u003e#808080\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_crop_background\"\u003e#000\u003c/color\u003e\n\n    \u003c!--Crop View--\u003e\n    \u003ccolor name=\"ucrop_color_default_crop_grid\"\u003e#80ffffff\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_default_crop_frame\"\u003e#ffffff\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_default_dimmed\"\u003e#8c000000\u003c/color\u003e\n    \u003ccolor name=\"ucrop_color_default_logo\"\u003e#4f212121\u003c/color\u003e\n```\n\n### Returned Result Arguments\n\nArgument | Type        | Result(s)\n-------- | ----------- | --------------------------------------------------------------------------\nresponse | string      | Success\u003cbr/\u003eCancelled\u003cbr/\u003eError\nimage    | ImageSource | `null` if there was an error or was cancelled\u003cbr/\u003e`ImageSource` on success\n\n### Bonus: Snippet for using with nativescript-imagepicker 6.x\n\n```js\nconst context = imagepickerModule.create({\n    mode: 'single' // allow choosing single image\n});\ncontext\n    .authorize()\n    .then(function() {\n        return context.present();\n    })\n    .then(function(selection) {\n        selection.forEach(function(selected) {\n            selected.getImageAsync(source =\u003e {\n              if (source) {\n                const selectedImgSource = imageSource.fromNativeSource(source);\n                imageCropper\n                    .show(selectedImgSource, { width: 500, height: 500 })\n                    .then(args =\u003e {\n                        if (args.image !== null) {\n                          // Use args.image\n                        }\n                    })\n                    .catch(function(e) {\n                        console.log(e);\n                    });\n              }\n            });\n        });\n    })\n    .catch(function(e) {\n        console.log(e);\n    });\n```\n","funding_links":[],"categories":["Plugins","Awesome {N} [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)"],"sub_categories":["Utility Plugins","Table of Contents"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbthurlow%2Fnativescript-imagecropper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbthurlow%2Fnativescript-imagecropper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbthurlow%2Fnativescript-imagecropper/lists"}