{"id":17766424,"url":"https://github.com/jonz94/capacitor-image-picker","last_synced_at":"2025-03-15T12:30:38.106Z","repository":{"id":61409838,"uuid":"547595159","full_name":"jonz94/capacitor-image-picker","owner":"jonz94","description":"⚡️ Capacitor plugin for multiple image selection.","archived":false,"fork":false,"pushed_at":"2025-01-22T05:40:34.000Z","size":704,"stargazers_count":14,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T20:51:15.969Z","etag":null,"topics":["android","capacitor","capacitor-android","capacitor-ios","capacitor-plugin","image-picker","ios"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@jonz94/capacitor-image-picker","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonz94.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2022-10-08T00:25:11.000Z","updated_at":"2025-02-06T12:38:43.000Z","dependencies_parsed_at":"2023-02-08T20:01:04.144Z","dependency_job_id":"17bf0326-8f8f-4264-8150-c20b59cd05ee","html_url":"https://github.com/jonz94/capacitor-image-picker","commit_stats":{"total_commits":51,"total_committers":1,"mean_commits":51.0,"dds":0.0,"last_synced_commit":"7db3000fd318d31671e3e19d2488115d633821e7"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonz94%2Fcapacitor-image-picker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonz94%2Fcapacitor-image-picker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonz94%2Fcapacitor-image-picker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonz94%2Fcapacitor-image-picker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonz94","download_url":"https://codeload.github.com/jonz94/capacitor-image-picker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243730915,"owners_count":20338734,"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","capacitor","capacitor-android","capacitor-ios","capacitor-plugin","image-picker","ios"],"created_at":"2024-10-26T20:29:25.698Z","updated_at":"2025-03-15T12:30:37.267Z","avatar_url":"https://github.com/jonz94.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cbr\u003e\u003cimg src=\"https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png\" width=\"128\" height=\"128\" /\u003e\u003c/p\u003e\n\u003ch3 align=\"center\"\u003eImage Picker\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\u003cstrong\u003e\u003ccode\u003e@jonz94/capacitor-image-picker\u003c/code\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  Capacitor plugin for multiple image selection.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jonz94/capacitor-image-picker/actions/workflows/ci.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/jonz94/capacitor-image-picker/ci.yml?branch=main\u0026logo=github\u0026style=flat-square\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@jonz94/capacitor-image-picker\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/@jonz94/capacitor-image-picker?style=flat-square\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@jonz94/capacitor-image-picker\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@jonz94/capacitor-image-picker?style=flat-square\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Install\n\n```bash\nnpm install @jonz94/capacitor-image-picker\nnpx cap sync\n```\n\n## iOS\n\n### Native Dependencies Setup\n\nThis plugin uses [a forked version](https://github.com/jonz94/YPImagePicker) of [YPImagePicker](https://github.com/Yummypets/YPImagePicker) under the hood.\n\nIn order to use this plugin, you need to manually modified `ios/App/Podfile` as following:\n\n```diff\ntarget 'App' do\n  capacitor_pods\n  # Add your Pods here\n+  pod 'YPImagePicker', :git =\u003e 'https://github.com/jonz94/YPImagePicker.git', :tag =\u003e '5.2.2.0'\nend\n```\n\nAfter modified `ios/App/Podfile`, make sure to run `pod update` command to sync up the iOS project.\n\n### Permissions\n\niOS requires the following usage description be added and filled out for your app in `Info.plist`:\n\n- `NSPhotoLibraryUsageDescription` (`Privacy - Photo Library Usage Description`)\n\nRead about [Configuring `Info.plist`](https://capacitorjs.com/docs/ios/configuration#configuring-infoplist) in the [iOS Guide](https://capacitorjs.com/docs/ios) for more information on setting iOS permissions in Xcode.\n\n## Android\n\n### Native Dependencies Setup\n\nThis plugin uses [a forked version](https://github.com/jonz94/TedImagePicker) of [TedImagePicker](https://github.com/ParkSangGwon/TedImagePicker) under the hood.\n\n#### Setup [JitPack](https://jitpack.io) Repository\n\nAdd following line to your `android/build.gradle`:\n\n```diff\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n+        maven { url \"https://jitpack.io\" }\n    }\n}\n```\n\n#### Enable Data Binding\n\nAdd following lines to your `android/app/build.gradle`:\n\n```diff\nandroid {\n    compileSdkVersion rootProject.ext.compileSdkVersion\n    defaultConfig {\n        // ...\n    }\n    buildTypes {\n        // ...\n    }\n+    dataBinding {\n+        enabled true\n+    }\n}\n```\n\n#### Sync Project\n\nAfter modified `android/build.gradle` and `android/app/build.gradle`, make sure to run `Sync Project with Gradle Files` in Android Studio.\n\n### Permissions\n\nThis plugin requires the following permissions be added to your `AndroidManifest.xml`:\n\n```xml\n\u003cuses-permission android:name=\"android.permission.READ_MEDIA_IMAGES\" /\u003e\n\u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" android:maxSdkVersion=\"32\" /\u003e\n```\n\nThe storage permissions are for reading photo files.\n\nRead about [Setting Permissions](https://capacitorjs.com/docs/android/configuration#setting-permissions) in the [Android Guide](https://capacitorjs.com/docs/android) for more information on setting Android permissions.\n\n## Configuration\n\nNo configuration required for this plugin.\n\n## Usage\n\n```typescript\nimport { ImagePicker } from '@jonz94/capacitor-image-picker';\n\nconst pickSingleImage = async () =\u003e {\n  const { images } = await ImagePicker.present();\n\n  // console.log(images[0]);\n\n  return images[0];\n}\n\nconst pickMultipleImages = async () =\u003e {\n  const { images } = await ImagePicker.present({ limit: 10 });\n\n  // console.log(images);\n\n  return images;\n}\n\nconst pickMultipleImagesWithCustomText = async () =\u003e {\n  const { images } = await ImagePicker.present({\n    limit: 10,\n    surpassLimitMessage: 'You cannot select more than %d images.',\n    titleText: 'Pick a image',\n    albumsTitleText: 'Chose an album',\n    libraryTitleText: 'Click here to change library',\n    cancelText: 'Go Back',\n    doneText: 'OK',\n  });\n\n  // console.log(images);\n\n  return images;\n}\n```\n\n## API\n\n\u003cdocgen-index\u003e\n\n* [`present(...)`](#present)\n* [Interfaces](#interfaces)\n\n\u003c/docgen-index\u003e\n\n\u003cdocgen-api\u003e\n\u003c!--Update the source file JSDoc comments and rerun docgen to update the docs below--\u003e\n\n### present(...)\n\n```typescript\npresent(options?: PresentOptions | undefined) =\u003e Promise\u003cImages\u003e\n```\n\n| Param         | Type                                                      |\n| ------------- | --------------------------------------------------------- |\n| **`options`** | \u003ccode\u003e\u003ca href=\"#presentoptions\"\u003ePresentOptions\u003c/a\u003e\u003c/code\u003e |\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;\u003ca href=\"#images\"\u003eImages\u003c/a\u003e\u0026gt;\u003c/code\u003e\n\n--------------------\n\n\n### Interfaces\n\n\n#### Images\n\n| Prop         | Type                 | Description                     | Since |\n| ------------ | -------------------- | ------------------------------- | ----- |\n| **`images`** | \u003ccode\u003eImage[]\u003c/code\u003e | Array of all the picked images. | 1.0.0 |\n\n\n#### Image\n\n| Prop           | Type                | Description                                                                                                       | Since |\n| -------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------- | ----- |\n| **`path`**     | \u003ccode\u003estring\u003c/code\u003e | The file path of the image.                                                                                       | 1.0.0 |\n| **`webPath`**  | \u003ccode\u003estring\u003c/code\u003e | webPath returns a path that can be used to set the src attribute of an image for efficient loading and rendering. | 1.0.0 |\n| **`mimeType`** | \u003ccode\u003estring\u003c/code\u003e | The mime type of the image.                                                                                       | 1.0.0 |\n\n\n#### PresentOptions\n\n| Prop                      | Type                | Description                                                                                                                                                                                                                   | Default                                       | Since |\n| ------------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ----- |\n| **`limit`**               | \u003ccode\u003enumber\u003c/code\u003e | Maximum number of images the user will be able to choose. Note: If this is set to 1, upon selection of a single image.                                                                                                        | \u003ccode\u003e1\u003c/code\u003e                                | 1.0.0 |\n| **`surpassLimitMessage`** | \u003ccode\u003estring\u003c/code\u003e | The message when user select more than maximum number of pictures. This message will not occur when `limit` is 1. Note: The message **MUST INCLUDE ONE AND ONLY ONE `%d`** as a placeholder for showing the value of `limit`. | \u003ccode\u003e\"You can only select %d images.\"\u003c/code\u003e | 1.0.0 |\n| **`titleText`**           | \u003ccode\u003estring\u003c/code\u003e | Android only: The title of the image picker.                                                                                                                                                                                  | \u003ccode\u003e\"Select Image\"\u003c/code\u003e                   | 1.0.0 |\n| **`albumAllText`**        | \u003ccode\u003estring\u003c/code\u003e | Android only: name of the all photos album.                                                                                                                                                                                   | \u003ccode\u003e\"All\"\u003c/code\u003e                            | 1.2.0 |\n| **`libraryTitleText`**    | \u003ccode\u003estring\u003c/code\u003e | iOS only: The title of the library.                                                                                                                                                                                           | \u003ccode\u003e\"Library\"\u003c/code\u003e                        | 1.0.0 |\n| **`albumsTitleText`**     | \u003ccode\u003estring\u003c/code\u003e | iOS only: The title of the albums.                                                                                                                                                                                            | \u003ccode\u003e\"Albums\"\u003c/code\u003e                         | 1.0.0 |\n| **`cancelText`**          | \u003ccode\u003estring\u003c/code\u003e | iOS only: The text to display on the cancel button. Note: on Android, the cancel button is shown as icon-only back button with no text.                                                                                       | \u003ccode\u003e\"Cancel\"\u003c/code\u003e                         | 1.0.0 |\n| **`doneText`**            | \u003ccode\u003estring\u003c/code\u003e | The text to display on the done button.                                                                                                                                                                                       | \u003ccode\u003e\"Done\"\u003c/code\u003e                           | 1.0.0 |\n\n\u003c/docgen-api\u003e\n\n## Changelog\n\nSee [CHANGELOG.md](https://github.com/jonz94/capacitor-image-picker/blob/main/CHANGELOG.md).\n\n## License\n\nSee [LICENSE](https://github.com/jonz94/capacitor-image-picker/blob/main/LICENSE).\n\n## Credits\n\n- [EinfachHans's Advanced ImagePicker Cordova Plugin](https://github.com/EinfachHans/cordova-plugin-advanced-imagepicker) inspires this Capacitor plugin.\n- [YPImagePicker](https://github.com/Yummypets/YPImagePicker) provides iOS implementation.\n- [TedImagePicker](https://github.com/ParkSangGwon/TedImagePicker) provides Android implementation.\n- [Official Capacitor Camera Plugin](https://github.com/ionic-team/capacitor-plugins/blob/%40capacitor/camera%404.1.2/camera/ios/Plugin/CameraPlugin.swift#L518-L527) provides `saveTemporaryImage()` implementation on iOS.\n- [Capawesome's Capacitor File Picker Plugin](https://github.com/capawesome-team/capacitor-file-picker/blob/v0.5.1/ios/Plugin/FilePicker.swift#L37-L46) provides `getMimeTypeFromURL()` implementation on iOS.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonz94%2Fcapacitor-image-picker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonz94%2Fcapacitor-image-picker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonz94%2Fcapacitor-image-picker/lists"}