{"id":17234402,"url":"https://github.com/sija/gphoto2-web","last_synced_at":"2025-10-12T07:38:28.439Z","repository":{"id":66278088,"uuid":"64361878","full_name":"Sija/gphoto2-web","owner":"Sija","description":"REST API for libgphoto2","archived":false,"fork":false,"pushed_at":"2025-09-05T13:36:16.000Z","size":114,"stargazers_count":13,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-19T01:24:24.638Z","etag":null,"topics":["api","camera","crystal","dslr","gphoto2","libgphoto2","photography","rest","web"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/Sija.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},"funding":{"github":"Sija","custom":["https://paypal.me/sijawusz","https://revolut.me/sija"]}},"created_at":"2016-07-28T03:38:39.000Z","updated_at":"2025-09-05T13:36:20.000Z","dependencies_parsed_at":"2023-12-25T23:28:45.086Z","dependency_job_id":"69a5a588-fffd-4e09-a7b6-9092369b2263","html_url":"https://github.com/Sija/gphoto2-web","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Sija/gphoto2-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sija%2Fgphoto2-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sija%2Fgphoto2-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sija%2Fgphoto2-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sija%2Fgphoto2-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sija","download_url":"https://codeload.github.com/Sija/gphoto2-web/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sija%2Fgphoto2-web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010666,"owners_count":26084784,"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-12T02:00:06.719Z","response_time":53,"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":["api","camera","crystal","dslr","gphoto2","libgphoto2","photography","rest","web"],"created_at":"2024-10-15T05:29:20.194Z","updated_at":"2025-10-12T07:38:28.396Z","avatar_url":"https://github.com/Sija.png","language":"Crystal","funding_links":["https://github.com/sponsors/Sija","https://paypal.me/sijawusz","https://revolut.me/sija"],"categories":[],"sub_categories":[],"readme":"# gphoto2-web [![CI](https://github.com/Sija/gphoto2-web/actions/workflows/ci.yml/badge.svg)](https://github.com/Sija/gphoto2-web/actions/workflows/ci.yml) [![License](https://img.shields.io/github/license/Sija/gphoto2-web.svg)](https://github.com/Sija/gphoto2-web/blob/master/LICENSE)\n\nREST web API for the [libgphoto2](http://www.gphoto.org) library. You can use it to take pictures, previews (handy for implementing poor man's liveview feature), control/obtain various camera settings, and access connected camera's filesystem - all via JSON-based requests.\n\n## Goals\n\n- Providing a generic camera REST API\n- Providing a feature parity with [libgphoto2](https://github.com/gphoto/libgphoto2) library\n- Being a testbed for [gphoto2.cr](https://github.com/Sija/gphoto2.cr) shard\n- Clean and readable code ✨\n- Rock-solid stability 🪨\n- High performance 🚀\n\n## Non-Goals\n\n- Including customizable business logic\n- Including camera-specific features\n\n## Features\n\n### 🐻 Necessities\n\n- Multiple cameras support\n- Camera detection\n- Camera identification\n- Camera connection reloading\n- Camera ability detection\n- Image capture [^1]\n- Live-view [^1]\n- Configuration reading/modification [^1]\n- Filesystem access [^1]\n\n### 🦊 Creature Comforts\n\n- Folder download as ZIP archive [^1]\n- Folder creation [^1]\n- Folder removal [^1]\n- File download (in several formats [^2]) [^1]\n- File preview (incl. _raw_ camera formats) [^1]\n- File upload [^1]\n- File removal [^1]\n\n[^1]: Works only with supported cameras\n[^2]: JPEG, WEBP, AVIF, PNG\n\n## Setup\n\n\u003e [!TIP]\n\u003e Passing `SENTRY_DSN` env var while building/running will provide you with error reporting\n\n- Run `shards install` in order to install required dependencies\n- Next, execute `shards build [--release] [-Dpreview_mt]` to build the binary\n- Now you're ready to go!\n  - It's as easy as running `./bin/server` in your terminal\n  - Checking the http://localhost:3000/cameras endpoint will give you a list of detected cameras\n\n## Usage\n\n### Available endpoints\n\n#### `/cameras`\n\n- `GET /cameras`\n\n    Parameters:\n\n    | name     | value  | description                        |\n    | -------- | ------ | ---------------------------------- |\n    | `reload` | `true` | Reloads the camera list beforehand |\n\n#### `/cameras/:id`\n\n- `GET /cameras/:id`\n- `GET /cameras/:id/capture`\n\n    Parameters:\n\n    | name     | value  | description                     |\n    | -------- | ------ | ------------------------------- |\n    | `delete` | `true` | Deletes the image after capture |\n\n- `GET /cameras/:id/preview`\n- `GET /cameras/:id/exit`\n\n#### `/cameras/:id/config`\n\n- `GET /cameras/:id/config`\n\n    Parameters:\n\n    | name     | value  | description                                                     |\n    | -------- | ------ | --------------------------------------------------------------- |\n    | `reload` | `true` | Reloads the camera configuration beforehand                     |\n    | `flat`   | `true` | Returns one-dimensional configuration map, keyed by widget name |\n\n- `PATCH /cameras/:id/config`\n\n    Example request:\n\n    ```sh\n    curl \\\n        -X PATCH \\\n        -H \"Accept: application/json\" \\\n        -H \"Content-Type: application/json\" \\\n        -d '{\"whitebalance\": \"Automatic\", \"iso\": 800, \"f-number\": \"f/4.5\"}' \\\n        \"http://localhost:3000/cameras/5a337150-30ba-40fd-adc2-b9ffacdad188/config\"\n    ```\n\n#### `/cameras/:id/config/:widget`\n\n- `GET /cameras/:id/config/:widget`\n- `PATCH /cameras/:id/config/:widget`\n\n    Example request:\n\n    ```sh\n    curl \\\n        -X PATCH \\\n        -H \"Accept: application/json\" \\\n        -H \"Content-Type: application/json\" \\\n        -d '{\"value\": \"Automatic\"}' \\\n        \"http://localhost:3000/cameras/5a337150-30ba-40fd-adc2-b9ffacdad188/config/whitebalance\"\n    ```\n\n#### `/cameras/:id/fs`\n\n- `GET /cameras/:id/fs`\n- `GET /cameras/:id/fs/*path`\n- `DELETE /cameras/:id/fs/*path`\n- `PUT /cameras/:id/fs/*path`\n\n    Example request:\n\n    ```sh\n    curl \\\n        -X PUT \\\n        -H \"Accept: application/json\" \\\n        \"http://localhost:3000/cameras/5a337150-30ba-40fd-adc2-b9ffacdad188/fs/store_00010001/DCIM007\"\n    ```\n\n#### `/cameras/:id/blob`\n\n- `GET /cameras/:id/blob/*filepath`\n\n    Parameters:\n\n    | name       | value                                     | description                                                                                                                                           |\n    | ---------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n    | `download` | `true`                                    | Makes the browser download the image instead of displaying it                                                                                         |\n    | `format`   | `jpeg` / `webp` / `avif` / `png` / `auto` | Returns the image in a given format, `auto` chooses between the original format, if it's supported by the browser, and falls back to `jpeg` otherwise |\n    | `width`    | *integer*                                 | Returns the image scaled down to the given width                                                                                                      |\n    | `height`   | *integer*                                 | Returns the image scaled down to the given height                                                                                                     |\n\n- `DELETE /cameras/:id/blob/*filepath`\n- `PUT /cameras/:id/blob/*path`\n\n    Example request:\n\n    ```sh\n    curl \\\n        -X PUT \\\n        -H \"Accept: application/json\" \\\n        -F file=\"@/path/to/file.jpg\" \\\n        \"http://localhost:3000/cameras/5a337150-30ba-40fd-adc2-b9ffacdad188/blob/store_00010001/DCIM007/IMG_0001.jpg\"\n    ```\n\n#### `/cameras/:id/zip`\n\n- `GET /cameras/:id/zip`\n- `GET /cameras/:id/zip/*path`\n\n## Development\n\n\u003e [!TIP]\n\u003e You can use a smartphone for basic development and testing.\n\n- Pass `DEBUG=1` in `shards build` step to compile-in the debug support. Afterwards you can use it by passing `DEBUG=1` env variable when running the server (`DEBUG=1 ./bin/server`)\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/Sija/gphoto2-web/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Sija](https://github.com/Sija) Sijawusz Pur Rahnama - creator, maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsija%2Fgphoto2-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsija%2Fgphoto2-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsija%2Fgphoto2-web/lists"}