|
Project Information
Featured
Downloads
|
Java bindings for Linux gphoto/gphoto2 library (see http://www.gphoto.org/ for details). ExampleSee the 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 JNA library is required to be present on the classpath (tested with version 3.0.9). Usage with Maven 2/3Add 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.1</version> </dependency> Reporting BugsIf 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. |