Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Sija/gphoto2-web
Web API for libgphoto2
https://github.com/Sija/gphoto2-web
api crystal gphoto2 libgphoto2 photography rest web
Last synced: about 2 months ago
JSON representation
Web API for libgphoto2
- Host: GitHub
- URL: https://github.com/Sija/gphoto2-web
- Owner: Sija
- License: mit
- Created: 2016-07-28T03:38:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T20:34:56.000Z (2 months ago)
- Last Synced: 2024-04-29T04:15:27.249Z (2 months ago)
- Topics: api, crystal, gphoto2, libgphoto2, photography, rest, web
- Language: Crystal
- Homepage:
- Size: 75.2 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-crystal - gphoto2-web.cr - Web API for libgphoto2 (Misc)
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)
REST 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.
## Installation
- After cloning the repo you need to call `shards install` in order to obtain needed dependencies
- Next, execute `shards build` (possibly with `--production` flag) to build the binary
- You're ready to go! It's as easy as running `./bin/server` and checking the http://localhost:3000/cameras for list of detected cameras
- Passing `SENTRY_DSN` env var while builing/running will provide you with error reporting## Usage
### Available endpoints
#### `/cameras`
- `GET /cameras[?reload=true]`
#### `/cameras/:id`
- `GET /cameras/:id`
- `GET /cameras/:id/capture[?delete=true]`
- `GET /cameras/:id/preview`
- `GET /cameras/:id/exit`#### `/cameras/:id/config`
- `GET /cameras/:id/config[?flat=true]`
- `PATCH /cameras/:id/config`#### `/cameras/:id/config/:widget`
- `GET /cameras/:id/config/:widget`
- `PATCH /cameras/:id/config/:widget`#### `/cameras/:id/fs`
- `GET /cameras/:id/fs`
- `GET /cameras/:id/fs/*path`
- `DELETE /cameras/:id/fs/*path`#### `/cameras/:id/blob`
- `GET /cameras/:id/blob/*filepath[?width=512&height=768]`
- `DELETE /cameras/:id/blob/*filepath`#### `/cameras/:id/zip`
- `GET /cameras/:id/zip`
- `GET /cameras/:id/zip/*path`## Development
- 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`)
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Sija](https://github.com/Sija) Sijawusz Pur Rahnama - creator, maintainer