All Projects → Sija → gphoto2.cr

Sija / gphoto2.cr

Licence: MIT license
Crystal shard wrapping libgphoto2

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to gphoto2.cr

meiupic
简洁好用的多用户图片社区。
Stars: ✭ 165 (+1078.57%)
Mutual labels:  photography
iptcinfo3
iptcinfo working for python 3 finally do pip3 install iptcinfo3
Stars: ✭ 37 (+164.29%)
Mutual labels:  photography
timeline
Timeline - A photo organizer
Stars: ✭ 39 (+178.57%)
Mutual labels:  photography
.com
Digital garden built using Next13, Typescript, and a bunch of goodies
Stars: ✭ 186 (+1228.57%)
Mutual labels:  photography
textile-facebook
[DEPRECATED] simple parsing tool to get your data out of a facebook export
Stars: ✭ 82 (+485.71%)
Mutual labels:  photography
camera
This program makes the use of a Raspberry Pi HQ camera a little more powerful and user-friendly. It unleashes easy exposure bracketing, timelapse functionality, etc. It also adds on-screen controls for use with touch screens, additional error handling, and presets for some common settings.
Stars: ✭ 32 (+128.57%)
Mutual labels:  photography
Geeqie
claiming to be the best image viewer / photo collection browser
Stars: ✭ 239 (+1607.14%)
Mutual labels:  photography
RethinkRAW
RethinkRAW is an unpretentious, free RAW photo editor.
Stars: ✭ 37 (+164.29%)
Mutual labels:  photography
go-unsplash
Go Client for the Unsplash API
Stars: ✭ 70 (+400%)
Mutual labels:  photography
denali
A simple, fast photoblogging CMS built in Ruby on Rails which features responsive, high-resolution images, a customizable posting schedule, social media management and syndication, a GraphQL API, and more.
Stars: ✭ 26 (+85.71%)
Mutual labels:  photography
moul
See https://github.com/moulco/moul
Stars: ✭ 17 (+21.43%)
Mutual labels:  photography
PhotoMiner
Photo finder application for macOS
Stars: ✭ 102 (+628.57%)
Mutual labels:  photography
colorchecker-detection
Multiple ColorChecker Detection. This code implements a multiple colorChecker detection method, as described in the paper Fast and Robust Multiple ColorChecker Detection.
Stars: ✭ 51 (+264.29%)
Mutual labels:  photography
CaptureOneScripts
A collection of AppleScripts for use with Capture One
Stars: ✭ 31 (+121.43%)
Mutual labels:  photography
gimp-elsamuko
Some GIMP scripts
Stars: ✭ 34 (+142.86%)
Mutual labels:  photography
envadrouille
Fast and customizable photo gallery.
Stars: ✭ 18 (+28.57%)
Mutual labels:  photography
rclip
AI-Powered Command-Line Photo Search Tool
Stars: ✭ 394 (+2714.29%)
Mutual labels:  photography
timelapse
Shell scripts for capturing and compiling timelapse photography
Stars: ✭ 27 (+92.86%)
Mutual labels:  photography
camera.zero
Combining Camera Zero with an Arducam 12MP camera, a Raspberry Pi Zero WH, a PiMoRoNi trackball breakout, and an Adafruit 16-LED NeoPixel ring will result in a neat little screenless camera that can be controlled with your thumb.
Stars: ✭ 26 (+85.71%)
Mutual labels:  photography
naturtag
Tag your nature photos with iNat taxonomy and observation metadata
Stars: ✭ 20 (+42.86%)
Mutual labels:  photography

gphoto2.cr CI Releases License

gphoto2.cr provides an FFI for common functions in libgphoto2. It also includes a facade to interact with the library in a more idiomatic Crystal way.

Installation

Prerequisites

  • Crystal >= 0.35.1
  • libgphoto2 >= 2.5.2
  • libgphoto2_port >= 0.10.1

To install the latest libgphoto2, you can use homebrew or apt-get, depending on the platform:

Mac OS X

$ brew install libgphoto2

Debian/Ubuntu

$ apt-get install libgphoto2-6 libgphoto2-dev libgphoto2-port12

Shard

Add this to your application's shard.yml:

dependencies:
  gphoto2:
    github: Sija/gphoto2.cr

Usage

require "gphoto2"

# list available cameras
cameras = GPhoto2::Camera.all
# => [#<GPhoto2::Camera>, ...]

# list found cameras by model and port path
cameras.map { |c| [c.model, c.port] }
# => [["Nikon DSC D5100 (PTP mode)", "usb:250,006"], ...]

# use the first camera
camera = cameras.first

# ...or more conveniently
camera = GPhoto2::Camera.first

# search by model name
camera = GPhoto2::Camera.where(model: /nikon/i).first

# the above examples require the camera be manually closed when done
camera.close

# pass a block to automatically close the camera
GPhoto2::Camera.first do |camera|
  # ...
end

# ...or use `#autorelease` on any `Camera` instance
camera.autorelease do
  # ...
end

# check camera abilities (see `GPhoto2::CameraOperation`)
camera.can? :capture_image
# => true

# list camera configuration names
camera.config.keys
# => ["autofocusdrive", "manualfocusdrive", "controlmode", ...]

# read the current configuration value of an option
camera[:expprogram].value
# => "M"
camera[:whitebalance].value
# => "Automatic"

# compare the current configuration value
camera[:whitebalance] == "Automatic"
camera[:whitebalance] == /Automatic/i
camera[:whitebalance] == :automatic
# => true

# list valid choices of a configuration option
camera[:whitebalance].as_radio.choices
# => ["Automatic", "Daylight", "Fluorescent", "Tungsten", ...]

# check if the configuration has changed
camera.dirty?
# => false

# change camera configuration
camera["iso"] = 800
camera["f-number"] = "f/4.5"
camera["shutterspeed2"] = "1/30"

# set radio widget value to first matching option
camera[:imageformat] = /Medium(.+?)JPEG/i

# check if the configuration has changed
camera.dirty?
# => true

# apply the new configuration to the device
camera.save

# alternatively, update the camera configuration in one go
camera.update({ iso: 200, shutterspeed2: "1/60", "f-number": "f/1.8" })

# ...do all of above while preserving camera original configuration
camera.preserving_config do
  # ...
end

# take a photo
file = camera.capture

# ...and save it to the current working directory
file.save

# ...or to a specific pathname
file.save("/tmp/out.jpg")

# traverse the camera filesystem
folder = camera/"store_00010001/DCIM/100D5100"

# list files
files = folder.files
folder.files.map(&.name)
# => ["DSC_0001.JPG", "DSC_0002.JPG", ...]

# copy a file from the camera
file = files.first
file.save

# ...and then delete it from the camera
file.delete

More examples can be found in examples/. Documentation can be generated using crystal doc task or browsed online.

Development

Enable debug mode by passing DEBUG=1 env variable:

DEBUG=1 crystal examples/list_cameras.cr

Run specs with:

crystal spec

Contributing

  1. Fork it (https://github.com/Sija/gphoto2.cr/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

Thanks! 🎉

  • The gphoto2 developers for building such an awesome tool
  • @zaeleus for the ffi-gphoto2 gem, on which this library is heavily inspired

Contributors

  • @Sija Sijawusz Pur Rahnama - creator, maintainer
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].