Giter Site home page Giter Site logo

yoonit-labs / nativescript-yoonit-camera Goto Github PK

View Code? Open in Web Editor NEW
94.0 94.0 7.0 4.53 MB

The most advanced and modern NativeScript Camera module for Android and iOS with a lot of awesome features

License: MIT License

Makefile 1.35% SCSS 1.60% Vue 22.75% JavaScript 22.03% Shell 3.70% Ruby 0.35% TypeScript 48.22%
android camera camerax-api computer-vision hacktoberfest ios machine-learning mlkit nativescript vuejs-plugin

nativescript-yoonit-camera's People

Contributors

dependabot[bot] avatar gabrielrizzo avatar goulartvic avatar luiguild avatar mbrufatto avatar ramosestudiante avatar teruyaharoldo 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  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

nativescript-yoonit-camera's Issues

Photo broken on Android 7.0

If the demo apps cannot help and there is no issue for your problem, tell us about it

Photo looks like this
Screenshot_20210103-121915

Which platform(s) does your issue occur on?

  • Android
  • Android 7.0.0
  • NVidia Shield (tablet)

Please, provide the following version numbers that your issue occurs with:

  • CLI: 7.1.1
  • Cross-platform modules: 7.1.0
  • Runtime: @nativescript/android 7.0.1
  • Plugin(s):
"dependencies": {
    "@nativescript-community/gps": "^2.1.5",
    "@nativescript-community/l": "^4.2.15",
    "@nativescript/core": "~7.1.0",
    "@nativescript/theme": "~2.3.0",
    "@nstudio/nativescript-floatingactionbutton": "^3.0.4",
    "@nstudio/nativescript-pulltorefresh": "^3.0.1",
    "@yoonit/nativescript-camera": "^2.0.0",
    "moment": "^2.29.1",
    "nativescript-app-tour": "^2.0.2",
    "nativescript-https": "^2.2.2",
    "nativescript-vibrate": "^4.0.1",
    "nativescript-windowed-modal": "file:./plugins/nativescript-windowed-modal-master/src"
  },
  "devDependencies": {
    "@nativescript/android": "7.0.1",
    "@nativescript/types": "7.1.0",
    "@nativescript/webpack": "~4.0.0",
    "node-sass": "^4.14.1"
  }

Please, tell us how to recreate the issue in as much detail as possible.

const {YoonitCamera} = require('@yoonit/nativescript-camera/Yoonit.Camera');

function cvLoaded(args) { 

    const cView = args.object; // <ContentView> in my XML
    yCam = new YoonitCamera();

    yCam.on('imageCaptured', (data) => {
        yCam.stopCapture();
        ImageSource.fromFile(data.image["path"]).then((img) => {
            const folder = knownFolders.documents().getFolder("orderPhotos").path;
            const fileName = moment().format('x') + '.jpg';
            const filePath = path.join(folder, fileName);
            const saved = img.saveToFile(filePath, "jpg");
            if (saved) {
                closeCallback(filePath);
            } else {
                
            }
        });
    });

    cView.content = yCam;

    yCam.requestPermission().then(() => {
        yCam.setLens('back');
        yCam.setOutputImageWidth("1000px");
        yCam.setOutputImageHeight("1000px");
        yCam.setSaveImageCaptured(true);
        yCam.preview();
    });
}

function onTakePhoto(args) {
    yCam.startCapture('frame');
}

TypeError: Cannot read property 'forEach' of null

Which platform(s) does your issue occur on?

  • Both
  • emulator

Please, provide the following version numbers that your issue occurs with:

  • CLI: 7.0.12
  • Cross-platform modules: 7.0.13
  • Plugin(s):
"dependencies": {
    "@nativescript/core": "^7.0.3",
    "@yoonit/nativescript-camera": "^2.1.0",
    "axios": "^0.21.1",
    "fastest-validator": "^1.9.0",
    "nativescript-ui-listview": "^9.1.0",
    "nativescript-vue": "^2.8.1",
    "nativescript-vue-fonticon": "^1.0.3",
    "vuex": "^3.5.1"
  },
  "devDependencies": {
    "@babel/core": "^7.11.6",
    "@babel/preset-env": "^7.11.5",
    "@nativescript/ios": "7.0.6",
    "@nativescript/android": "7.0.1",
    "@nativescript/webpack": "^3.0.4",
    "babel-loader": "^8.1.0",
    "nativescript-vue-template-compiler": "^2.8.1",
    "nativescript-worker-loader": "~0.12.1",
    "sass": "^1.26.10",
    "vue-loader": "^15.9.3"
  }

Please, tell us how to recreate the issue in as much detail as possible.

Occurs when you use YoonitCamera component and then call the $ navigate Back function and remount the component, then throw TypeError error: Cannot read property 'forEach' of null.

java.lang.Exception on taking photo on Android 8

If the demo apps cannot help and there is no issue for your problem, tell us about it

When taking a photo with startCapture('frame') console reports this:

System.err: java.lang.Exception: Stack trace
System.err:     at java.lang.Thread.dumpStack(Thread.java:1346)
System.err:     at androidx.camera.camera2.internal.CaptureSession.issueRepeatingCaptureRequests(CaptureSession.java:599)
System.err:     at androidx.camera.camera2.internal.CaptureSession.setSessionConfig(CaptureSession.java:166)
System.err:     at androidx.camera.camera2.internal.Camera2CameraImpl.updateCaptureSessionConfig(Camera2CameraImpl.java:914)
System.err:     at androidx.camera.camera2.internal.Camera2CameraImpl.lambda$onUseCaseInactive$6$Camera2CameraImpl(Camera2CameraImpl.java:562)
System.err:     at androidx.camera.camera2.internal.-$$Lambda$Camera2CameraImpl$L-qXzxII6_fhY_FN_HX18hvqHpE.run(Unknown Source:4)
System.err:     at androidx.camera.core.impl.utils.executor.SequentialExecutor$1.run(SequentialExecutor.java:110)
System.err:     at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:230)
System.err:     at androidx.camera.core.impl.utils.executor.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:172)
System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
System.err:     at java.lang.Thread.run(Thread.java:764)

But photo saved successfully

Which platform(s) does your issue occur on?

  • Android
  • Android 8.0.0
  • HTC 10 (mobile phone)

Please, provide the following version numbers that your issue occurs with:

  • CLI: 7.1.1
  • Cross-platform modules: 7.1.0
  • Runtime: @nativescript/android 7.0.1
  • Plugin(s):
"dependencies": {
    "@nativescript-community/gps": "^2.1.5",
    "@nativescript-community/l": "^4.2.15",
    "@nativescript/core": "~7.1.0",
    "@nativescript/theme": "~2.3.0",
    "@nstudio/nativescript-floatingactionbutton": "^3.0.4",
    "@nstudio/nativescript-pulltorefresh": "^3.0.1",
    "@yoonit/nativescript-camera": "^2.0.0",
    "moment": "^2.29.1",
    "nativescript-app-tour": "^2.0.2",
    "nativescript-https": "^2.2.2",
    "nativescript-vibrate": "^4.0.1",
    "nativescript-windowed-modal": "file:./plugins/nativescript-windowed-modal-master/src"
  },
  "devDependencies": {
    "@nativescript/android": "7.0.1",
    "@nativescript/types": "7.1.0",
    "@nativescript/webpack": "~4.0.0",
    "node-sass": "^4.14.1"
  }

Please, tell us how to recreate the issue in as much detail as possible.

const {YoonitCamera} = require('@yoonit/nativescript-camera/Yoonit.Camera');

function cvLoaded(args) { 

    const cView = args.object; // <ContentView> in my XML
    yCam = new YoonitCamera();

    yCam.on('imageCaptured', (data) => {
        yCam.stopCapture();
        ImageSource.fromFile(data.image["path"]).then((img) => {
            const folder = knownFolders.documents().getFolder("orderPhotos").path;
            const fileName = moment().format('x') + '.jpg';
            const filePath = path.join(folder, fileName);
            const saved = img.saveToFile(filePath, "jpg");
            if (saved) {
                closeCallback(filePath);
            } else {
                
            }
        });
    });

    cView.content = yCam;

    yCam.requestPermission().then(() => {
        yCam.setLens('back');
        yCam.setOutputImageWidth("1000px");
        yCam.setOutputImageHeight("1000px");
        yCam.setSaveImageCaptured(true);
        yCam.preview();
    });
}

function onTakePhoto(args) {
    yCam.startCapture('frame');
}

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.