GithubHelp home page GithubHelp logo

Porting to NAN about node-gphoto2 HOT 28 CLOSED

lwille avatar lwille commented on August 17, 2024
Porting to NAN

from node-gphoto2.

Comments (28)

catesq avatar catesq commented on August 17, 2024 5

Sorry about the all-in-one PR. The main changes are:

  • Updated to the current nan.

  • Fixed the gphoto.on('log', callback) method - gphoto.setLoglevel 2 and 3 were so verbose that some messages were being dropped by libuv coalescing events.

  • getConfig is working again (could only find partial examples and unsure if the object it builds has exactly the same structure...).

  • Changed setConfig so it does some basic type conversion and menu/option lookups - especially useful for 'choice' + 'menu' type settings ie on my camera setConfig('capturetarget', 0) now works the same as setConfig('capturetarget', 'Internal RAM').

It passes the tests - apart from a livepreview test that my camera doesn't support. I haven't tried tested it with anything from the examples dir.

from node-gphoto2.

lyonlai avatar lyonlai commented on August 17, 2024 2

Alright, here it is. I'll give it a try to make it compile again first.

from node-gphoto2.

lwille avatar lwille commented on August 17, 2024 2

merged #92 into feature/nan. Thank you all, especially @mitnuh, for your contributions and support!

I'd like to ask for some help with testing (still no camera ☚ī¸):

  • Manual tests against current Node LTS with camera on OSX
  • Manual tests against current Node LTS with camera on Linux

Please run the tests and use the files from the examples.
Testing against your own project can be done easily by using npm link:

git clone [email protected]:lwille/node-gphoto2.git && cd node-gphoto2
git checkout feature/nan
npm install
npm link
# cd to your project directory
npm link gphoto2

from node-gphoto2.

IvanDhalluin avatar IvanDhalluin commented on August 17, 2024 2

It's working fine on OSX (node v7.7.1) with livepreview on my project :) (but the example seems to be broken)

from node-gphoto2.

Sija avatar Sija commented on August 17, 2024 2

@lwille need any help with the next releases? I could help you with maintenance if you like.

from node-gphoto2.

elijahparker avatar elijahparker commented on August 17, 2024 1

@mitnuh: this looks great -- thanks so much! This module has been holding back the node version in my project and I hadn't found the time to tackle this yet, so thank you very much for your work here!

from node-gphoto2.

Sija avatar Sija commented on August 17, 2024 1

@lwille ping

from node-gphoto2.

Sija avatar Sija commented on August 17, 2024 1

@lwille 🏓 There are people waiting for this update for almost 3 yrs now...

from node-gphoto2.

dubcanada avatar dubcanada commented on August 17, 2024

Is feature/nan working? Minus the refactors.

from node-gphoto2.

lwille avatar lwille commented on August 17, 2024

No, it's not - I didn't even test it yet 😊

On Wed, Apr 15, 2015 at 11:29 PM, dubcanada [email protected]
wrote:

Is feature/nan working? Minus the refactors.

Reply to this email directly or view it on GitHub:
#67 (comment)

from node-gphoto2.

dubcanada avatar dubcanada commented on August 17, 2024

I am in need of this for a project I am working on. I am debating helping you with the NAN stuff or using node-ffi.

Was there any reason you choose to create C node bindings, rather then using FFI?

from node-gphoto2.

lwille avatar lwille commented on August 17, 2024

As libgphoto2 requires some sort of threading, FFI wasn't an option when I started development. Also, I didn't find a way to easily handle structs (now possible with ref-struct).

I just read that node-ffi meanwhile supports async calls and will definitely reconsider it,
especially because it will reduce most of the compilation hassle and ease up development :)

Have you already done some async work with FFI?

Before making such a choice, it would be great to have some proof of concept (open camera, take picture) using FFI.

There's a similar project done in Ruby (https://github.com/zaeleus/ffi-gphoto2).
I guess some boilerplate (structs!) could be generated with ffi-generate (if that's still working)...

You're very welcome to contribute!

from node-gphoto2.

dubcanada avatar dubcanada commented on August 17, 2024

I'm going to spend a while over the next two days trying to get a proof of concept working with FFI. I only need open camera, and take photo, and then download photo working for my project so I'll show you that when I get done/working/not working lol

from node-gphoto2.

dubcanada avatar dubcanada commented on August 17, 2024

Didn't have a lot of luck with the whole node-ffi. A ton of really weird complicated pointers and things in libgpphoto2.

I'll start playing around with your nan version and try to get that to work. I think that's probably a better solution anyways.

from node-gphoto2.

lwille avatar lwille commented on August 17, 2024

Thanks for trying it :)
You'll notice that since removing cvv8, there's no way to retrieve the camera settings. I'd appreciate help on that feature :)

(Just added that to the task list, so we won't forget)

from node-gphoto2.

leroyvi avatar leroyvi commented on August 17, 2024

Hi lwille

Do you have any news on this subject ? I really like your lib but working with node 0.10 is really annoying.
I will see if I can help but my c++ is very rusty.

from node-gphoto2.

dubcanada avatar dubcanada commented on August 17, 2024

It largely works with node 0.10+ already with the nan version just a few
things missing.

On Fri, 3 Jul 2015 6:18 am Nataku [email protected] wrote:

Hi lwille

Do you have any news on this subject ? I really like your lib but working
with node 0.10 is really annoying.
I will see if I can help but my c++ is very rusty.

—
Reply to this email directly or view it on GitHub
#67 (comment).

from node-gphoto2.

sescandell avatar sescandell commented on August 17, 2024

Hi there,

First of all, many thanks for this work. What you've made is so cool!

Just wondering what's the status about Node 0.10+ support?

Any idea when it will be available?

Many thanks,

from node-gphoto2.

elijahparker avatar elijahparker commented on August 17, 2024

I just saw this thread now -- I've been working porting my fork to nan the last couple weeks (didn't get very far yet). Where is this at now? I'd love to help out if I can. Thanks!

from node-gphoto2.

geloescht avatar geloescht commented on August 17, 2024

Any news on this? Right now I am trying to use the gphoto2 cli with child_process. It works well, but I guess a proper node module could be more fool-proof.

from node-gphoto2.

sorenkrabbe avatar sorenkrabbe commented on August 17, 2024

Just wanted to echo the enthusiasm around @mitnuh's contribution. Can't wait to see the PR merged...

from node-gphoto2.

catesq avatar catesq commented on August 17, 2024

Thanks for testing it Ivan :) the latest pull request seems to get the example working again.

from node-gphoto2.

lwille avatar lwille commented on August 17, 2024

@mitnuh thanks for merging, please make sure to reference this issue (#67) in your future merges ;-) I'll try to get hold of a camera to test on Linux so we can finally release.

from node-gphoto2.

naeluh avatar naeluh commented on August 17, 2024

I have a canon 500d that I am going to test this against in ubuntu 14.04 this weekend, I will let you ifi ti works.
thanks !

from node-gphoto2.

IvanDhalluin avatar IvanDhalluin commented on August 17, 2024

It's working perfectly on Ubuntu for me (tested with 2 Canon).

from node-gphoto2.

Sija avatar Sija commented on August 17, 2024

Seems like it's GTG, yay! Big thanks to @mitnuh for making this happen, and of course to @lwille for keeping an eye and stewardship of this branch.

from node-gphoto2.

rhclayto avatar rhclayto commented on August 17, 2024

Any news?

from node-gphoto2.

lwille avatar lwille commented on August 17, 2024

@Sija please go ahead! I currently don't have the resources to actively work on this project.

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.