• Stars
    star
    6
  • Rank 2,539,965 (Top 51 %)
  • Language
    Crystal
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Web API for libgphoto2

gphoto2-web CI License

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.

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 building/running will provide you with error reporting

Usage

Available endpoints

/cameras

  • GET /cameras

    Parameters:

    name value description
    reload true Reloads the camera list beforehand

/cameras/:id

  • 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

/cameras/:id/config

  • GET /cameras/:id/config

    Parameters:

    name value description
    flat true Returns one-dimensional configuration map, keyed by widget name
  • 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

    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 between avif, webp and jpeg (in that order), depending on the browser support
    width 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

/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 (https://github.com/Sija/gphoto2-web/fork)
  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 Sijawusz Pur Rahnama - creator, maintainer

More Repositories

1

garb

A Ruby wrapper for the Google Analytics API
Ruby
147
star
2

raven.cr

Raven is a Crystal client for Sentry
Crystal
120
star
3

debug.cr

Debug macro for Crystal
Crystal
92
star
4

ipaddress.cr

A Crystal library to handle IPv4 and IPv6 addresses in a modern and productive way.
Crystal
43
star
5

retriable.cr

Retriable.cr is a simple DSL to retry failed code blocks
Crystal
38
star
6

any_hash.cr

Better JSON::Any for Crystal
Crystal
33
star
7

blurhash.cr

A pure Crystal implementation of BlurHash algorithm
Crystal
22
star
8

backtracer.cr

Crystal shard aiming to assist with parsing backtraces into a structured form.
Crystal
16
star
9

crystal-dash-docset

Dash docset generator for Crystal
Shell
16
star
10

ksuid.cr

Crystal implementation of K-Sortable Globally Unique IDs
Crystal
16
star
11

gphoto2.cr

Crystal shard wrapping libgphoto2
Crystal
15
star
12

climate.cr

Tiny tool to make your CLI output 🌈 coloured
Crystal
14
star
13

serialport.cr

Crystal bindings for libserialport: cross-platform library for accessing serial ports.
Crystal
12
star
14

base62.cr

Base62 encoder/decoder for Crystal
Crystal
10
star
15

crystal-environment

Crystal::Environment
Crystal
7
star
16

gitbook2pdf

CLI utility to turn a published GitBook website into a collection of PDFs for offline reading
JavaScript
3
star
17

Gizmo

Quick'n'easy file based content management system
PHP
2
star
18

jsonl.cr

Crystal shard for handling JSONL (JSON Lines) parsing
Crystal
1
star
19

Sija

1
star
20

coffeeshop

Unfinished Coffee powered, Express based framework for Node.js
CoffeeScript
1
star
21

kPilot.w3

Web backend for kPilot Konnekt IM plugin.
PHP
1
star
22

markdown

PSR-0 compliant Markdown library
PHP
1
star
23

seedling

Rails 3 plugin for a database-independent YAML seeds import/export.
Ruby
1
star
24

MazeSolver

Maze solver written in PHP 5.
PHP
1
star
25

kZmieniacz

kZmieniacz to wtyczka dla komunikatora Konnekt pozwalająca zmieniać status opisowy jednocześnie we wszystkich wykorzystywanych sieciach.
C++
1
star
26

photoindex

Ancient, self-contained php gallery script.
PHP
1
star
27

resque-dry

Ruby
1
star
28

swift

Never finished C++ templating engine.
C++
1
star
29

kulturadaru

PHP
1
star
30

smartypants

PSR-0 compliant Smartypants library
PHP
1
star
31

kAway

Away system for the Konnekt IM
C++
1
star
32

git-rewrite-author

CLI tool for rewriting author/committer history of a git repository
Crystal
1
star
33

QRKit

QR Reader in Objective C ported from zxing
C++
1
star
34

thumb-cutter

Blazingly fast thumb cutting and image juggling middleware for any node/express.js kitchen sink
JavaScript
1
star
35

sunspot_resque

Sunspot-Resque Session Proxy
Ruby
1
star
36

jquery.clamp

JavaScript with CSS "overflow: ellipsis" line clamping, as jQuery plugin and standalone AMD module
CoffeeScript
1
star