GithubHelp home page GithubHelp logo

Live Preview about node-gphoto2 HOT 4 CLOSED

lwille avatar lwille commented on August 17, 2024
Live Preview

from node-gphoto2.

Comments (4)

lwille avatar lwille commented on August 17, 2024

Hi Jacob, try testing first with the gphoto command line interface.
But you're right, although I didn't test that model personally, it should work with the T3i (called EOS 600D in Europe).

from node-gphoto2.

jacobsologub avatar jacobsologub commented on August 17, 2024

Hi Leonhardt,

Here's some more info...

Running the following command using gphoto 2.5.2/libgphoto2 2.5.2

gphoto2 --capture-preview

gives the following

*** Error (-1: 'Unspecified error') ***

I can see it try to write a file in my home dir but then it bails.

Here's the interesting bit, running the following:

gphoto2 --set-config output=1
gphoto2 --set-config output=0
gphoto2 --capture-preview

works. I found this solution here: http://gphoto-software.10949.n7.nabble.com/capture-preview-returns-error-other-commands-work-td9006.html. I also updated the firmware on the actual camera after reading this http://sourceforge.net/p/gphoto/support-requests/94/.

In any case, I tried to emulate this using the node library

setConfigValue ("output", "PC", function (er) {};

but still no luck.

from node-gphoto2.

jacobsologub avatar jacobsologub commented on August 17, 2024

Hi Leonhardt,

Here's an update on this. After some hours playing around with the lib, the gphoto2 command line interface and a post on the mailing list...

So I got gphoto2 --capture-preview working but only in shell mode, so:

gphoto2 --shell
capture-preview

The first call to capture-preview always fails I think it's a timing issue in gphoto, subsequent calls succeed and I can get the capture_preview.jpg on disk.

Using the library I'm experiencing the same; The first call returns -1 which is probably the same as the -1 'Unspecified error" the command line interface returns on the first run. Subsequent calls do not return an error, but the data that's returned from takePicture ({ preview: true }) is an empty string.

Thanks
-Jacob

from node-gphoto2.

jacobsologub avatar jacobsologub commented on August 17, 2024

Hi Leonhardt,

Here's a patch that worked for me.

diff --git a/src/camera_helpers.cc b/src/camera_helpers.cc
index a7be5316605a1af5b3a324706cd670d57d870057..88c795b6d2b59fe7b9b986044309a2bd2b084f73 100644
--- a/src/camera_helpers.cc
+++ b/src/camera_helpers.cc
@@ -327,6 +327,10 @@ GPCamera::capturePreview(take_picture_request *req){
     gp_file_free(file);
   }

+  if(retval == GP_OK && req->download){
+    retval = gp_file_get_data_and_size (file, &req->data, &req->length);
+  }
+
   req->ret = retval;
 }

call

camera.takePicture ({ preview: true, download: true } function (er, data) {});

Thanks
-Jacob

from node-gphoto2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.