Automatically exported from code.google.com/p/gphoto2-java
Clone or download
Martin Vysny
Martin Vysny updated readme
Latest commit 5b1bea5 Sep 5, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main JNA bump to 4.2.2 Sep 4, 2016
.gitignore ported to github Mar 16, 2015
README.md updated readme Sep 5, 2016
pom.xml JNA bump to 4.2.2 Sep 4, 2016

README.md

GPhoto2 Java Bindings

Java bindings for Linux gphoto/gphoto2 library (see http://www.gphoto.org/ for details).

Example

See the https://github.com/mvysny/gphoto2-java/blob/master/src/main/java/org/gphoto2/Camera.java file for example on usage. Simple usage:

System.out.println("GPhoto version: " + getLibraryVersion());
final CameraList cl = new CameraList();
System.out.println("Cameras: " + cl);
CameraUtils.closeQuietly(cl);
final Camera c = new Camera();
c.initialize();
final CameraFile cf2 = c.captureImage();
cf2.save(new File("captured.jpg").getAbsolutePath());
CameraUtils.closeQuietly(cf2);
CameraUtils.closeQuietly(c);

Note that the https://github.com/twall/jna library is required to be present on the classpath (1.4 and prior versions tested with JNA 3.0.9, 1.5 tested with JNA 4.2.2).

Downloads

Please find all downloadable artefacts here: http://www.baka.sk/maven2/org/gphoto/gphoto2-java/

Usage with Maven 2/3

Add the baka.sk maven 2 repo to your maven installation - edit ~/.m2/settings.xml so that it will look like the following:

<settings>
 <profiles>
  <profile>
   <id>default</id>
   <activation><activeByDefault>true</activeByDefault></activation>
   <repositories>
    <repository>
     <id>baka</id>
     <name>baka.sk</name>
     <url>http://www.baka.sk/maven2</url>
    </repository>
   </repositories>
  </profile>
 </profiles>
</settings>

Then add the following to your dependencies:

<dependency>
 <groupId>org.gphoto</groupId>
 <artifactId>gphoto2-java</artifactId>
 <version>1.5</version>
</dependency>

Reporting Bugs

If your camera is not working as expected, please try it out with gphoto2 (gphoto2 --capture-image) before reporting bugs for this project. gphoto2-related bugs will be closed as invalid.