Comments (4)
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.
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.
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.
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)
- Build issue with macports HOT 2
- No preview / no download
- Segmentation fault: 11 HOT 12
- Re-check the camera connection? HOT 4
- Capture Movie with additional parameters possible? HOT 1
- node-gphoto2 internal error
- Error on importing the module HOT 1
- Raspberry pi 3 b+
- GPhoto2 and Socket.IO incompatible HOT 2
- Pre-install should not install libgphoto2 on Mac OS HOT 2
- Capture movie with lib ? HOT 1
- windows support HOT 4
- Build error on node 12 HOT 3
- error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’ HOT 4
- Event listeners
- After using "takePicture" the camera is stuck. HOT 2
- Nan::ObjectWrap::Unref(): Assertion `!persistent().IsWeak()' failed. HOT 3
- change binding.gyp for mac for build the package HOT 1
- mach-o file have 'x86_64', need 'arm64e' HOT 1
- please make a release HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-gphoto2.