Skip to content

Commit

Permalink
Merge fix_examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Aug 8, 2018
2 parents 47c4d0c + 1629105 commit dba7529
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ test/spec/*.js.map
.vscode

/.nyc_output/
/test/integration/app/spec/swagger.json
/test/integration/app/spec/swagger.json
/examples/*.jpeg
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,13 @@ cameraList.close();

## Examples

Some example
Some example are available in the `examples` directory.

Before run example, run `npm run build` then `node examples/camera.js`.

## Contributors
Please read [contributing guidelines here](./CONTRIBUTING.md).

Contributors and PR are welcome. Before, just read [contributing guidelines here](./CONTRIBUTING.md) ;)

<a href="https://github.com/romakita/ts-express-decorators/graphs/contributors"><img src="https://opencollective.com/tsed/contributors.svg?width=890" /></a>

Expand Down
2 changes: 1 addition & 1 deletion examples/abilities-list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { checkCode } from '../src/driver';
const { checkCode } = require('../lib/driver');

const { AbilitiesList, PortInfoList, GPhoto2Driver } = require('../src');
const ref = require('ref');
Expand Down
2 changes: 1 addition & 1 deletion examples/camera-autoselect.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Camera, closeQuietly } = require('../src');
const { Camera, closeQuietly } = require('../lib');
const path = require('path');
const camera = new Camera();

Expand Down
2 changes: 1 addition & 1 deletion examples/camera-info.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const SegfaultHandler = require('segfault-handler');
const path = require('path');
const { CameraList, closeQuietly } = require('../src');
const { CameraList, closeQuietly } = require('../lib');

SegfaultHandler.registerHandler('crash.log');

Expand Down
2 changes: 1 addition & 1 deletion examples/camera-list-autodetect.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const SegfaultHandler = require('segfault-handler');
const { CameraList } = require('../src');
const { CameraList, PortInfoList } = require('../lib');

SegfaultHandler.registerHandler('crash.log');

Expand Down
2 changes: 1 addition & 1 deletion examples/camera-list-populate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const SegfaultHandler = require('segfault-handler');
const { CameraList, PortInfoList } = require('../src');
const { CameraList, PortInfoList } = require('../lib');

SegfaultHandler.registerHandler('crash.log');

Expand Down
2 changes: 1 addition & 1 deletion examples/camera-scenario-async.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Camera, closeQuietly, CameraWidgets } = require('../src');
const { Camera, closeQuietly, CameraWidgets } = require('../lib');
const path = require('path');

const camera = new Camera();
Expand Down
2 changes: 1 addition & 1 deletion examples/camera-scenario.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Camera, closeQuietly, CameraWidgets } = require('../src');
const { Camera, closeQuietly, CameraWidgets } = require('../lib');
const path = require('path');

const camera = new Camera();
Expand Down
2 changes: 1 addition & 1 deletion examples/camera.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const SegfaultHandler = require('segfault-handler');
const path = require('path');
const { CameraList, closeQuietly } = require('../src');
const { CameraList, closeQuietly } = require('../lib');

SegfaultHandler.registerHandler('crash.log');

Expand Down
Binary file removed examples/capture-1.jpeg
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/port-list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { PortInfoList } = require('../src');
const { PortInfoList } = require('../lib');

const portList = new PortInfoList();

Expand Down
2 changes: 1 addition & 1 deletion examples/widgets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require('path');
const { CameraList, closeQuietly } = require('../src');
const { CameraList, closeQuietly } = require('../lib');

SegfaultHandler.registerHandler('crash.log');

Expand Down
18 changes: 18 additions & 0 deletions src/driver/modules/GPFileModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const GP_FILE_MODULE_ASYNC_KEYS: string[] = ["gp_file_save"];
// tslint:disable-next-line: variable-name
export const GPFileModuleDescription = {
gp_file_new: ["int", [refType(RefCameraFile)]],
gp_file_new_from_fd: ["int", [refType(RefCameraFile), "int"]],
gp_file_get_mime_type: ["int", [RefCameraFile, refType(types.CString)]],
gp_file_ref: ["int", [RefCameraFile]],
gp_file_clean: ["int", [RefCameraFile]],
gp_file_save: ["int", [RefCameraFile, types.CString]],
Expand All @@ -22,6 +24,22 @@ export interface IGPFileModule {
*/
gp_file_new(buffer: PointerOf<PointerCameraFile>): GPCodes;

/**
* Create new {@link CameraFile} object from a UNIX filedescriptor.
* @param {PointerOf<PointerCameraFile>} buffer
* @param {number} fd
* @returns {GPCodes}
*/
gp_file_new_from_fd(buffer: PointerOf<PointerCameraFile>, fd: number): GPCodes;

/**
*
* @param {PointerCameraFile} file
* @param {PointerOf<string>} mime
* @returns {GPCodes}
*/
gp_file_get_mime_type(file: PointerCameraFile, mime: PointerOf<string>): GPCodes;

/**
*
* @param {PointerCameraFile} cameraFile
Expand Down

0 comments on commit dba7529

Please sign in to comment.