{"id":25650641,"url":"https://github.com/enertrag/photopicker","last_synced_at":"2025-07-03T00:05:38.344Z","repository":{"id":47709674,"uuid":"353465493","full_name":"enertrag/photopicker","owner":"enertrag","description":"Multi-selection image picker plugin for Capacitor.","archived":false,"fork":false,"pushed_at":"2021-08-17T07:49:13.000Z","size":139,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T16:06:28.388Z","etag":null,"topics":["android","capacitor","imagepicker","ionic","ios","multiselect","multiselection","photopicker","plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","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/enertrag.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":"2021-03-31T19:18:40.000Z","updated_at":"2021-08-17T07:46:38.000Z","dependencies_parsed_at":"2022-08-21T00:00:58.340Z","dependency_job_id":null,"html_url":"https://github.com/enertrag/photopicker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/enertrag/photopicker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enertrag%2Fphotopicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enertrag%2Fphotopicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enertrag%2Fphotopicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enertrag%2Fphotopicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enertrag","download_url":"https://codeload.github.com/enertrag/photopicker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enertrag%2Fphotopicker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263234943,"owners_count":23434918,"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","imagepicker","ionic","ios","multiselect","multiselection","photopicker","plugin"],"created_at":"2025-02-23T15:17:15.666Z","updated_at":"2025-07-03T00:05:38.256Z","avatar_url":"https://github.com/enertrag.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capacitor (Multi-) Photopicker Plugin\n\n[![version](https://img.shields.io/github/package-json/v/enertrag/photopicker)](https://github.com/enertrag/photopicker)\n[![npm](https://img.shields.io/npm/v/@enertrag/photopicker.svg)](https://www.npmjs.com/package/@enertrag/photopicker)\n[![issues](https://img.shields.io/github/issues/enertrag/photopicker)](https://github.com/enertrag/photopicker/issues)\n[![license](https://img.shields.io/github/license/enertrag/photopicker)](https://github.com/enertrag/photopicker/blob/main/LICENSE)\n\nThe Photopicker API allows the user to select one or more photos from the system-wide media library.\n\nThe selected photos can be (down)scaled and compressed. The data is provided in the form of temporary files in the user's cache directory. The API provides the URIs of the processed photos.\n\nIn order to use the photos in a Capacitor application, they have to be moved from the cache directory to the final storage location.\n\n## Installation\n\n```bash\nnpm install @enertrag/photopicker\n```\n\n_(Of course, the usual Capacitor procedure \u003ccode\u003enpx cap sync\u003c/code\u003e must be executed afterwards.)_\n\n## iOS Notes\n\n**_Important:_** **this plugin requires iOS 14 or later.**\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\nSelected images are persisted in the users cache (temporary) folder. As mentioned you should move it to the final destination.\n\n## Android Notes\n\nTo use this plugin you have to register it in your MainActivity.\n\n```java\nimport ...\nimport com.enertrag.plugins.photopicker.Photopicker;\n\npublic class MainActivity extends BridgeActivity {\n\n  @Override\n  public void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n\n    // Initializes the Bridge\n    this.init(savedInstanceState, new ArrayList\u003cClass\u003c? extends Plugin\u003e\u003e() {{\n      // Additional plugins you've installed go here\n      add(Photopicker.class);\n    }});\n  }\n}\n```\n\nOn your MainActivity.java file add \u003ccode\u003eimport com.enertrag.plugins.photopicker.Photopicker;\u003c/code\u003e and then inside the init callback \u003ccode\u003eadd(Photopicker.class);\u003c/code\u003e\n\nThis API requires the following permissions be added to your `AndroidManifest.xml`:\n\n```xml\n\u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/\u003e\n\u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n```\n\nThe storage permissions are for reading/saving 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## Example\n\n```typescript\nimport { Plugins } from '@capacitor/core';\nconst { Photopicker } = Plugins;\n\n...\n\nasync addPhotos() {\n\n      const result = await Photopicker.getPhotos();\n      if (result.selected) {\n\n        for (const url of result.urls) {\n            // ... do something with the url if it's not empty\n            if(url) {\n                // ...\n            }\n        }\n      }\n}\n```\n\nAlternatively, if the code completion does not work, the import can be formulated as follows:\n\n```typescript\nimport { EAGPhotopicker } from 'enertrag-photopicker';\nconst Photopicker = new EAGPhotopicker();\n```\n\n## API\n\n### getPhotos()\n\n```typescript\ngetPhotos(options: PhotopickerOptions) =\u003e Promise\u003cPhotopickerResponse\u003e\n```\n\nPrompt the user to pick one or more photos from an album.\n\nThe method call may fail if the user denies the permission request.\n\n**Returns:** \u003ccode\u003ePromise\u0026lt;PhotopickerResponse\u0026gt;\u003c/code\u003e\n\n## Interfaces\n\n### PhotopickerOptions\n\n| Prop          | Type                | Description                                                                                                                                                                                         |\n| ------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`maxSize`** | \u003ccode\u003enumber\u003c/code\u003e | The maximum length of one side of the photo. The photo is scaled according to the aspect ratio. The value \u003ccode\u003e0\u003c/code\u003e leaves the photo in its original resolution. The photo is never scaled up. |\n| **`quality`** | \u003ccode\u003enumber\u003c/code\u003e | The image quality on a scale from 10 (highest compression) to 100 (best quality).                                                                                                                   |\n\n### PhotopickerResponse\n\n| Prop           | Type                  | Description                                                                                            |\n| -------------- | --------------------- | ------------------------------------------------------------------------------------------------------ |\n| **`selected`** | \u003ccode\u003eboolean\u003c/code\u003e  | Shows whether the user has selected photos (\u003ccode\u003etrue\u003c/code\u003e) or not (\u003ccode\u003efalse\u003c/code\u003e).            |\n| **`urls`**     | \u003ccode\u003estring[]\u003c/code\u003e | The URIs of the selected and converted photos. This might contain empty elements for errornous photos. |\n\n## Implementation\n\nThe exciting parts of the source code for Android can be found [here](https://github.com/enertrag/photopicker/blob/main/android/src/main/java/com/enertrag/plugins/photopicker/Photopicker.java). The ones for iOS are [here](https://github.com/enertrag/photopicker/blob/main/ios/Plugin/Plugin.swift).\n\n## License\n\n[MIT](https://github.com/enertrag/photopicker/blob/main/LICENSE)\n\nCopyright © 2021 ENERTRAG AG\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenertrag%2Fphotopicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenertrag%2Fphotopicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenertrag%2Fphotopicker/lists"}