{"id":18347885,"url":"https://github.com/collaborne/cordova-gallery-access","last_synced_at":"2025-04-06T09:31:30.107Z","repository":{"id":57207546,"uuid":"78273136","full_name":"Collaborne/cordova-gallery-access","owner":"Collaborne","description":"Reads photos \u0026 videos from an album (e.g. Camera Roll) and returns them as dataURLs","archived":false,"fork":false,"pushed_at":"2019-08-10T21:27:24.000Z","size":38,"stargazers_count":15,"open_issues_count":4,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-21T21:11:40.291Z","etag":null,"topics":[],"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/Collaborne.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":"2017-01-07T10:39:27.000Z","updated_at":"2020-06-29T06:30:49.000Z","dependencies_parsed_at":"2022-09-08T14:20:07.327Z","dependency_job_id":null,"html_url":"https://github.com/Collaborne/cordova-gallery-access","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collaborne%2Fcordova-gallery-access","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collaborne%2Fcordova-gallery-access/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collaborne%2Fcordova-gallery-access/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Collaborne%2Fcordova-gallery-access/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Collaborne","download_url":"https://codeload.github.com/Collaborne/cordova-gallery-access/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247463744,"owners_count":20942935,"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":[],"created_at":"2024-11-05T21:15:28.970Z","updated_at":"2025-04-06T09:31:29.749Z","avatar_url":"https://github.com/Collaborne.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cordova-gallery-access [![Build Status](https://travis-ci.org/Collaborne/cordova-gallery-access.svg)](https://travis-ci.org/Collaborne/cordova-gallery-access)\n\nReads photos \u0026 videos from an album (e.g. Camera Roll)\n\nTested for iOS and Android. Likely works also for other platforms (but not tested).\n\nThis [blog post](https://medium.com/collaborne-engineering/my-cordova-nightmares-accessing-photos-from-the-phones-gallery-7528a0860555#.jq0oqswb8) explains the challenges that this library addresses and the approach how it solves them.\n\nThe module can automatically check if the user granted the required permission.\nFor Android 6 permission checks this requires to add [cordova-plugin-android-permission](https://github.com/NeoLSN/cordova-plugin-android-permission) to the Cordova application.\n\n\n## Install\n\n~~~~\nnpm install cordova-gallery-access --save\n~~~~\n\nThe library uses the Cordova plugin [cordova-gallery-api](https://github.com/Collaborne/cordova-gallery-api.git),\nwhich you therefore need to install to your Cordova application:\n\n```bash\ncordova plugin add https://github.com/Collaborne/cordova-gallery-api.git --save --nofetch\n```\n\n## Usage\n\nThis examples shows the recently taken photos from the Camera Roll:\n\n```javascript\n\nimport * as cordovaGallery from 'cordova-gallery-access';\n\ncordovaGallery.load().then(items =\u003e {\n    let html = '';\n    items.forEach(item =\u003e {\n        html += `\u003cimg src=\"file://${item.thumbnail}\"\u003e\u003c/img\u003e`;\n    });\n\n    document.getElementById(\"content\").innerHTML = html;\n}).catch(e =\u003e console.error(e));\n```\n\nThe `load` method supports optional parameters:\n\n```javascript\ncordovaGallery.load({\n    albumType: 'PHAssetCollectionSubtypeSmartAlbumUserLibrary',\n    count: 10\n});\n```\n\nSupported options:\n\n| Option        | Description                                          |\n| ------------- | ---------------------------------------------------- |\n| **albumType** | Type of the album from which the items will be taken |\n| **count**     | Maximal number of items that will be returned        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcollaborne%2Fcordova-gallery-access","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcollaborne%2Fcordova-gallery-access","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcollaborne%2Fcordova-gallery-access/lists"}