REST web API for the libgphoto2 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.
- 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 building/running will provide you with error reporting
-
GET /cameras
Parameters:
name value description reload
true
Reloads the camera list beforehand
-
GET /cameras/:id
-
GET /cameras/:id/capture
Parameters:
name value description delete
true
Deletes the image after capture -
GET /cameras/:id/preview
-
GET /cameras/:id/exit
-
GET /cameras/:id/config
Parameters:
name value description flat
true
Returns one-dimensional configuration map, keyed by widget name -
PATCH /cameras/:id/config
GET /cameras/:id/config/:widget
PATCH /cameras/:id/config/:widget
GET /cameras/:id/fs
GET /cameras/:id/fs/*path
DELETE /cameras/:id/fs/*path
-
GET /cameras/:id/blob/*filepath
Parameters:
name value description download
true
Make the browser download the image instead of displaying it format
jpeg
/webp
/avif
/png
/auto
Returns the image in a given format, auto
chooses betweenavif
,webp
andjpeg
(in that order), depending on the browser supportwidth
integer Returns the image scaled down to the given width height
integer Returns the image scaled down to the given height -
DELETE /cameras/:id/blob/*filepath
GET /cameras/:id/zip
GET /cameras/:id/zip/*path
- Pass
DEBUG=1
inshards build
step to compile-in the debug support. Afterwards you can use it by passingDEBUG=1
env variable when running the server (DEBUG=1 ./bin/server
)
- Fork it (https://github.com/Sija/gphoto2-web/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Sija Sijawusz Pur Rahnama - creator, maintainer