Coder Social home page Coder Social logo

tsedio / ts-gphoto2-driver Goto Github PK

View Code? Open in Web Editor NEW
73.0 15.0 21.0 8.84 MB

๐Ÿ“ท A Node.js wrapper for libgphoto2 written in TypeScript. Useful for remote controlling of DSLRs and other digital cameras supported by gphoto2.

License: MIT License

TypeScript 62.76% JavaScript 1.24% Shell 0.06% HTML 0.33% CSS 34.08% Dockerfile 0.49% EJS 1.05%
hacktoberfest gphoto2-driver typescript gphoto2 camera libgphoto2 camerafile

ts-gphoto2-driver's Introduction

Ts.ED logo

Ts.ED GPhotoDriver2

Build & Release PR Welcome Coverage Status npm version semantic-release code style: prettier backers


Slack ย ย โ€ขย ย  Twitter

A Node.js wrapper for libgphoto2 written in TypeScript. Useful for remote controlling of DSLRs and other digital cameras supported by gphoto2.

Features

  • Camera autodetection,
  • Take a picture/movie capture,
  • Take a preview,
  • Retrieve camera list,
  • Select camera,
  • Take a liveview from camera and get binary or base64 of each frame, or write it to file,
  • Display info about your camera (summary, about, manual).

Know issue

This package isn't compatible with Node.js 13 and higher version. @tsed/gphoto2-driver use ref-array-napi which have a bug with some node.js version related here.

The possible solutions would be:

  • Find a way not to use ref-array-napi to manipulate C++ Array in Node.js,
  • That the author of the module finds a solution to correct the problem,
  • Redevelop the driver directly with NAPI.

Obviously any help is welcome to move the project forward :)

Prerequisite

  • Node.js: 12
  • NPM: ~7.10.0
  • Nan: ~2.8.0
  • libgphoto2: ~2.5.x - via brew install libgphoto2, apt-get install libgphoto2-dev or download and build from http://www.gphoto.org/proj/libgphoto2/,
  • pkg-config | dpkg (used for dependency checking)
  • clang compiler

Note: This package cannot be used in front-end context (like webpack, browserify, etc...). You have to develop your own web server and expose your API.

Installation

Linux / Mac OS Intel

brew install libgphoto2

// or
apt-get install libgphoto2-dev

// then
npm install @tsed/gphoto2-driver

Mac OS M1 (Rosetta)

On Mac M1 chipset, you have to install homebrew with the x64 architecture:

/usr/sbin/softwareupdate --install-rosetta

arch -x86_64 zsh
mkdir ~/Downloads/homebrew
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
sudo mv ~/Downloads/homebrew /usr/local/homebrew
sudo chmod 755 /usr/local/homebrew/bin/brew
arch -x86_64 /usr/local/homebrew/bin/brew install libgphoto2

arch -arm64 zsh

Create brew alias. Edit your ~/.zshrc file and add the followings lines:

export PATH=$HOME/bin:/usr/local/bin:$PATH

alias xbrew='arch -x86_64 /usr/local/homebrew/bin/brew'

Now you can run brew with x64 architecture by usin xbrew alias:

xbrew install libgphoto2

You also need to install Node.js with the appropriate:

arch -x86_64 zsh
nvm install v12
nvm use v12
npm install @tsed/gphoto2-driver
arch -arm64 zsh

Check if your camera is detected

GPhoto2 CLI can help you to know if your camera is correctly detected by the libphoto2 driver. It can help to determine if the the detection issue is related from the driver or from the Ts.ED GPhoto2 library.

Install the GPhoto2 CLI:

// MacOs
brew install gphoto2

// Linux
sudo apt install gphoto2

Demo

Run:

yarn start

Then open the browser on http://localhost:3000

The demo code source is inside packages/client and packages/server.

Usage

Here an example with TypeScript (works also with pure javascript in Node.js):

import Path from "path";
import {CameraList, run} from "@tsed/gphoto2-driver";

run(
  () => {
    const cameraList = new CameraList().load();

    if (cameraList.size) {
      const camera = cameraList.getCamera(0);
      const cameraFile = camera.captureImage();

      cameraFile.save(path.join(__dirname, "capture.jpeg"));
    }
  },
  {logLevel: "debug"}
);

CameraFile

A lot of different API's of this library returns a CameraFile object.

This object does not contain the image, it is just a pointer to the file in camera's RAM.

You have several options to get your image:

  1. Use .save(filename) of .saveAsync(filename) methods, that will save the image to your filesystem.
  2. Use .getDataAndSizeAsync('binary' | 'base64') method, which returns following object:
{
  data: data, // Buffer for binary format and string for base64.
  size: size
}

Examples

Some examples are available in the packages/examples/src directory, when you have cloned or downloaded the complete project from github.

Checkout this project then run npm run install:examples && npm run develop and run node examples/camera.ts.

Contribute

Contributors and PR are welcome. Before, just read contributing guidelines here ;)

License

The MIT License (MIT)

Copyright (c) 2016 - 2021 Romain Lenzotti

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ts-gphoto2-driver's People

Contributors

dependabot[bot] avatar esarthou avatar goooseman avatar jmcomby avatar loic5 avatar nic2012 avatar romakita avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ts-gphoto2-driver's Issues

Illegal instruction error from example code.

I am trying to use this library to operate one of our Sony Alpha-A7R III, i tried to use node-gphoto2 before, but ran into some issues with the capturing of multiple images after each other.

So i was trying out this library, however i am not even getting the simplest of examples running without getting Node.JS to throw me illegal instructions errors. I am running v14.16.1 of Node.JS at the moment.

I hope you have any points as to which direction i should take this. If you need more information please let me know and ill provide it.

My current code (one of your examples)


const { Camera, closeQuietly, GPPortType, GPCameraDriverStatus, GPCameraFileOperation, GPCameraFolderOperation, GPDeviceType } = require('@tsed/gphoto2-driver');
const camera = new Camera();

try {
    console.log('[GPDRIVER] Camera init');
    camera.initialize();

    console.log('==> abilities.model', camera.getAbilities().model);
    console.log('==> abilities.port', GPPortType[camera.getAbilities().port]);
    console.log('==> abilities.status', GPCameraDriverStatus[camera.getAbilities().status]);
    console.log('==> abilities.id', camera.getAbilities().id);
    console.log('==> abilities.library', camera.getAbilities().library);
    console.log('==> abilities.operation', camera.getAbilities().operation);
    console.log('==> abilities.fileOperations', GPCameraFileOperation[camera.getAbilities().fileOperations]);
    console.log('==> abilities.folderOperations', GPCameraFolderOperation[camera.getAbilities().folderOperations]);
    console.log('==> abilities.usbVendor', camera.getAbilities().usbVendor);
    console.log('==> abilities.usbProduct', camera.getAbilities().usbProduct);
    console.log('==> abilities.usbClass', camera.getAbilities().usbClass);
    console.log('==> abilities.usbSubclass', camera.getAbilities().usbSubclass);
    console.log('==> abilities.deviceType', GPDeviceType[camera.getAbilities().deviceType]);
    console.log('==> abilities.speed', camera.getAbilities().speed);

} catch (er) {
    console.error(er.message);
} finally {
    closeQuietly(camera);
}
[GPDRIVER] Camera init


#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 0x7ffeefbfdf20
 1: 0x1001141a2 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
 2: 0x101007d83 V8_Fatal(char const*, ...) [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
 3: 0x1004d4f6d v8::internal::GlobalBackingStoreRegistry::Register(std::__1::shared_ptr<v8::internal::BackingStore>) [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
 4: 0x1001fb476 v8::ArrayBuffer::GetBackingStore() [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
 5: 0x10006a17e napi_get_typedarray_info [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
 6: 0x1054c8706 (anonymous namespace)::WrapPointer(Napi::Env, char*, unsigned long) [/Users/terencedoets/Projects/labelflip-control/node_modules/ref-struct-napi/node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
 7: 0x1054c9019 (anonymous namespace)::ReadPointer(Napi::CallbackInfo const&) [/Users/terencedoets/Projects/labelflip-control/node_modules/ref-struct-napi/node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
 8: 0x1054b55af napi_value__* Napi::details::WrapCallback<Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*)::'lambda'()>(Napi::Value (*)(Napi::CallbackInfo const&)) [/Users/terencedoets/Projects/labelflip-control/node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
 9: 0x1054b554d Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*) [/Users/terencedoets/Projects/labelflip-control/node_modules/ref-napi/prebuilds/darwin-x64/node.napi.node]
10: 0x10006b94a v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
11: 0x100259848 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
12: 0x100258ddc v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
13: 0x100258542 v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
14: 0x100a719b9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/terencedoets/.nvm/versions/node/v14.16.1/bin/node]
Illegal instruction: 4

I have the package installed along with gphoto2 and the gphoto lib version

$ npm view @tsed/gphoto2-driver

@tsed/[email protected] | MIT | deps: 5 | versions: 2
Node.js wrapper of C library libgphoto2 written in TypeScript
https://github.com/TypedProject/ts-gphoto2-driver/tree/production/packages/gphoto2-driver

keywords: gphoto-driver, typescript, driver, apn, reflex

dist
.tarball: https://registry.npmjs.org/@tsed/gphoto2-driver/-/gphoto2-driver-3.0.1.tgz
.shasum: 194b6dbe8ba7cfc4ed8ac2bf114ea4ba323955b6
.integrity: sha512-yfjyYmxqWlcqQBezV8kM5NTaUfshajr8YkizjiN2dR/lVfL0N9JhOZ/TBfw8gyAFd8NSVZaGR2VnWYlSpb5C/g==
.unpackedSize: 175.6 kB

dependencies:
@tsed/core: 6.43.4         @tsed/gphoto2-core: 3.0.1  @tsed/logger: 5.13.2       source-map-support: 0.5.19 tslib: 2.2.0               

maintainers:
- romakita <[email protected]>

dist-tags:
latest: 3.0.1  

published 3 weeks ago by romakita <[email protected]>

Brew package installed info

$ brew info libgphoto2
libgphoto2: stable 2.5.27 (bottled), HEAD
Gphoto2 digital camera library
http://www.gphoto.org/proj/libgphoto2/
/usr/local/Cellar/libgphoto2/2.5.27 (129 files, 96MB) *
  Poured from bottle on 2021-04-30 at 15:58:32
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libgphoto2.rb
License: LGPL-2.1-or-later
==> Dependencies
Build: pkg-config โœ”
Required: gd โœ”, libtool โœ”, libusb-compat โœ”
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 889 (30 days), 3,637 (90 days), 14,333 (365 days)
install-on-request: 542 (30 days), 2,422 (90 days), 6,432 (365 days)
build-error: 0 (30 days)
$ npm --version
7.12.1
$ npm view nan

[email protected] | MIT | deps: none | versions: 81
Native Abstractions for Node.js: C++ header for Node 0.8 -> 14 compatibility
https://github.com/nodejs/nan#readme

dist
.tarball: https://registry.npmjs.org/nan/-/nan-2.14.2.tgz
.shasum: f5376400695168f4cc694ac9393d0c9585eeea19
.integrity: sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==
.unpackedSize: 418.0 kB

maintainers:
- kkoopa <[email protected]>
- rvagg <[email protected]>

dist-tags:
latest: 2.14.2  

published 7 months ago by kkoopa <[email protected]>

Installation

Please help me and guide me, I can't run the proyect, I clone de repository, then I run "npm install" command, then I run "npm install @typedproject/gphoto2-driver" and then I want to run the "npm run install:examples" to try the app, but I can't because when I run the "npm run install:examples" command, the terminal show me error that I can't understand, what I do bad?

Triggering bulb mode explicitly, is it possible to then download the file?

Hi there,

I've got a Canon 5D3 that I'm trying to trigger bulb mode captures with.

I'm successfully able to set
/actions/eosremoterelease to Press Full then
/actions/eosremoterelease to Release Full
to trigger a capture, the file is then stored in memory in the camera, but I'm having trouble downloading that file to the computer.

I'm attempting to do this:

    const cameraFilePath = new GPhoto.CameraFilePath()

    const cameraFile = await cameraFilePath.newFileAsync(this.camera.pointer)

    if (!cameraFile) {
      console.warn('cameraFile was undefined', cameraFile)
      return
    }

    const { data } = await cameraFile.getDataAndSizeAsync('binary')

    console.log('Fetched camera file')

But the await cameraFile.getDataAndSizeAsync('binary') call is erroring with this:

Error: reinterpret: Cannot reinterpret from NULL pointer

I don't understand how the CameraFile's path and filename properties are being set? They're both blank. I also don't understand how cameraFile's pointer gets set?

cameraFile.pointer is seemingly an empty buffer
cameraFile.buffer is 30dd7151a47f0000 in hex

I can successfully trigger a regular capture with:

const cameraFile = await this.camera.captureImageAsync()
const { data } = await cameraFile.getDataAndSizeAsync('binary')

Thanks for your help.

Project build fails on M1 Macs

Hi there,

I've noticed that running npm install on this repo on an M1 mac results in a failure:

CC(target) Release/obj.target/ffi/deps/libffi/src/prep_cif.o ../deps/libffi/src/prep_cif.c:26:10: fatal error: 'ffi.h' file not found #include <ffi.h> ^~~~~~~ โ ด Building module: ffi-napi, Completed: 01 error generated. make: *** [Release/obj.target/ffi/deps/libffi/src/prep_cif.o] Error 1 โœ– Rebuild Failed

This error is caused by this dependency 'ffi-napi' adn was fixed on their repo here:
node-ffi-napi/node-ffi-napi#118
node-ffi-napi/node-ffi-napi@e09bb91

I'm opening a PR to update the dependency to its latest version

EDIT: PR: #26

Async captures

Hi there,

I'm calling camera.captureImageAsync() and it appears to block?

Is there a trick to getting this to work asyncronously?

I'm using a Canon 6D if that's helpful, on MacOS.

[BUG] Crash on start (with or without camera connected)

Information

  • Version: 3.0.3
  • libgphoto2 version: 2.5.27-1

When I tried this out today, on my Arch machine, it crashes node instantly when trying to get the first camera - even if there is a camera connected or not.

Example

const CameraList = require("@tsed/gphoto2-driver").CameraList;
new CameraList().load();

Output

$ node -e "const CameraList = require('@tsed/gphoto2-driver').CameraList; new CameraList().load();"
[2021-11-18T01:00:52.878] [DEBUG] [default] - Load library from libgphoto2
[2021-11-18T01:00:52.941] [DEBUG] [default] - Load port info list...


#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 0x7ffc7817a880
 1: 0x55b4a805e4b3  [node]
 2: 0x55b4a8b4da88 V8_Fatal(char const*, ...) [node]
 3: 0x55b4a848bccc v8::internal::GlobalBackingStoreRegistry::Register(std::shared_ptr<v8::internal::BackingStore>) [node]
 4: 0x55b4a81efb4f v8::ArrayBuffer::GetBackingStore() [node]
 5: 0x55b4a7f98976 napi_get_typedarray_info [node]
 6: 0x7fe519bab430  [/home/me/node_modules/ref-struct-napi/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
 7: 0x7fe519bb0f5f Napi::details::CallbackData<Napi::Value (*)(Napi::CallbackInfo const&), Napi::Value>::Wrapper(napi_env__*, napi_callback_info__*) [/home/mef/server/node_modules/ref-struct-napi/node_modules/ref-napi/prebuilds/linux-x64/node.napi.node]
 8: 0x55b4a7f8f123  [node]
 9: 0x55b4a821ecde  [node]
10: 0x55b4a821f9bf v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x55b4a8a1c6b9  [node]

delete photo on camera

Hi,
is there any way how to delete photo on camera or capture photo without saving the photo on camera?

Thanks

Type 'typeof internal' is not a constructor function type

After importing your project with
npm install @typedproject/gphoto2-driver
I got this error when i compiling my project:

node_modules/@typedproject/gphoto2-driver/lib/components/Liveview.d.ts:5:39 - error TS2507: Type 'typeof internal' is not a constructor function type.
5 export declare class Liveview extends EventEmitter implements ICloseable {

My tsconfig.json:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"outDir": "./build",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"resolveJsonModule": true,
"esModuleInterop": true
}
}

Node version: 10.16.0

[Feat] Liveview, captureVideoAsync saves empty file, captureVideo just returns the error

Dear @Romakita,

Thanks for the great lib. It is a very good replacement of an old node-gphoto2 project. I can help with documentation and maybe some collaboration if I will understand some primary aspects of the library.

Because for now there are some misunderstandings.

What I'm trying to achieve is to view the live preview video file.

What I have:

  • Canon 80D
  • GPhoto2 2.5.17 installed with brew on Mac
  • --capture-movie flag works fine with my camera. Tested with gphoto2-liveview-example.

So first, I'm initialising a camera object. This is easy.

import { Camera, closeQuietly } from "@typedproject/gphoto2-driver";
const camera = new Camera();
camera.initialize();

Then I'm trying to use captureVideo and getting an error:

camera.captureVideo(); // gp_camera_capture returned -6: Unsupported operation

Ok, let's try an async method. It works and returns CameraFile object. So let's try to save this file after 5 secs.

let video;
try {
  video = await camera.captureVideoAsync();
} catch (e) {
  console.error('Video err', e);
}
console.log('buffer.length', video.buffer.length); // 8
const date = new Date();
const pathToSave = path.join(__dirname, `../.tmp/video-${date.toString()}.mp4`);
setTimeout(async () => {
  console.log('before save buffer.length', video.buffer.length); // 8
  console.log('ref', video.ref()); // undefined
  try {
    const result = await video.saveAsync(pathToSave);
    console.log('saved', result); // 0
  } catch (e) {
    console.error('save err', e);
  }
  video.closeQuietly();
  camera.closeQuietly();
}, 5000);

The code works as expected, do not throw any errors at all.
But the result file is 0 bytes.

Plus, what is more interesting: I definitely do not hear the sound of mirror shutter, so I believe or it is filming a black screen, or it even do not start to do anything. When I use gphoto2 --capture-movie --stdout in the terminal the shutter sound definitely exists.

Looking forward for any help. I can contribute to the library by myself, but for now I can not understand where to dig.

[BUG] segfault-handler is not intalled by default

Information

While testing the example code under node v12.22.8, installing gphoto2-driver with npm install @tsed/gphoto2-driver is not sufficient. User need to install segfault-handler separately: npm i segfault-handler

Example

const path = require('path')
const {CameraList, run} = require("@tsed/gphoto2-driver")

run(
  () => {
    const cameraList = new CameraList().load()

    if (cameraList.size) {
      const camera = cameraList.getCamera(0)
      const cameraFile = camera.captureImage()

      cameraFile.save(path.join(__dirname, "capture.jpeg"));
    }
  },
  {logLevel: "debug"}
);

Thanks for this great library

getter on single prop

Hi,
following scenario:
1)

let cfg = new CameraWidgets(camera);
...
cfg.get('/capturesettings/shutterspeed2').value = '1/1000';

camera was set on M (manual mode) and shutter is now at 1/1000
2)
cfg.get('/capturesettings/expprogram').value = 'A';
switching to mode A (shutter will be autom. set depending on light conditions)
3) cfg.get('/capturesettings/shutterspeed2').value > still on '1/1000', but camera shows diff. value :(
4) To see actual value I have to recall new CameraWidgets(camera) again!

Each call new CameraWidgets() costs with 334 properties on my camera around 3 seconds :(

I see that y have changed the code that new CameraWidgets() fills a Map and every get returns the entry from Map not from camera directly.

Imagine there are e.g. batterylevel or lightmeter values that are always changed by camera, is there any single getter call on certain prop to the camera?

Nic

TypeScript => possibility of integrating this into NativeScript?

Nice job putting this together in TypeScript! So, I have a question (sorry if I'm not adhering to proper Github etiquette here):

TLDR: how difficult would it be to port this over into an iOS project?

There are several threads in the Gphoto universe which, previously, questioned whether incorporating Gphoto's functionality into XCode/iOS projects would be feasible. The Gphoto devs seemed to think it wouldn't work -- for Apple's AppStore distribution purposes -- due to the use of private and/or low-level frameworks which weren't accessible or permitted. However; these discussions also took place several years ago, and the Apple eco system is constantly evolving, so I'm wondering how feasible it would be to do this today.

Also, given that NativeScript allows the usage of TypeScript, how far fetched of a possibility would it be to port this into NativeScript for iOS purposes -- for private (less restrictions on library use) or public distribution?

I know we could just create a WebView connecting to a local server running on a desktop or Android phone, and then use CGI or other scripts to trigger the functionality. I'm curious as to how we could pull this off running it as a standalone app without external server requirements.

Cheers!

2.4.0 throws an error

Steps to reproduce the issue:

  1. Install 2.4.0 version of the library
  2. Use it

Actual

Screen Shot 2020-05-06 at 6 54 02
Screen Shot 2020-05-06 at 6 57 32

TS compiler leaves

require("./@types/ref-array-napi");
require("./@types/ref-struct-napi");

in the JS code, which can not be imported.

Luckily, this problem is already fixed in the production branch. Just need to do a patch release.

Change require path in examples

When users have installed the driver from npm, fetch examples from github and run it immediately afterwards, scripts ends with an exception:

node camera.js
module.js:538
    throw err;
    ^
Error: Cannot find module '../src'
    at Function.Module._resolveFilename (module.js:536:15)...

Change require path e.g. from
const { CameraList, closeQuietly } = require('../src');
to
const { CameraList, closeQuietly } = require('@typedproject/gphoto2-driver');

@Romakita: When its ok for y, I ll fix it.

[Feat] Camera Storage info

As a developer I want a method to get all storage info available on a Camera.

Example GPPhoto2

gphoto2 --storage-info
[Storage 0]
label=NIKON D70
basedir=/store_00010001
access=2 Read-only with delete
type=4 Removable RAM
fstype=4 Camera layout (DCIM)
totalcapacity=7822432 KB
free=7452704 KB
freeimages=697

StorageInfo interface

{
  "label": "NIKON D70",
  "basedir": "/store_00010001",
  "access": "2 Read-only with delete",
  "type": "4 Removable RAM",
  "fstype": "4 Camera layout (DCIM)",
  "totalcapacity": "7822432 KB",
  "free": "7452704 KB",
   "freeimages": 697
}

Acceptance criteria

  • Add method Camera.storageInfo(): StorageInfo[]
  • Return an array of StorageInfo

Exists any get or set method?

Hi,
how can i set or get a single config value e.g. shutterspeed, iso...?

Thank you providing us this wrapper.

Best regards,
Nic

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.