Code Monkey home page Code Monkey logo

Comments (6)

dmarcs avatar dmarcs commented on July 26, 2024 4

@ospfranco thanks for looking into this. I'm using EXTRA_OUTPUT intentionally because I want the final image to be as large as possible.

It sounds like I can fix this problem by scaling the image before showing the preview.

from react-native-document-scanner-plugin.

ospfranco avatar ospfranco commented on July 26, 2024

Things I found out:

  • According to this stack_overflow question using EXTRA_OUTPUT increases the file size.

  • You seem to be taking the raw image data and raw drawing it into a buffer/canvas to show the preview, which seems to me to be the cause of the crash.

  • if I set letUserAdjustCrop: false then the canvas activity is skipped and then the app no longer crashes, which makes sense since the picture is not drawn into a canvas anymore. This is a workaround, but the real problem is the naive implementation of loading the entire image data into a canvas.

from react-native-document-scanner-plugin.

dmarcs avatar dmarcs commented on July 26, 2024

I can't reproduce this error, so I need someone to confirm that it's fixed in 0.73

WebsiteBeaver/android-document-scanner#26

if photo is larger than 100MB, resize the photo so it's smaller

from react-native-document-scanner-plugin.

ospfranco avatar ospfranco commented on July 26, 2024

Wouldn't close the issue until it is confirmed to be fixed

from react-native-document-scanner-plugin.

ZXY101 avatar ZXY101 commented on July 26, 2024

@ospfranco I was experiencing this issue when I used my front camera, can confirm it's fixed for me in 0.7.3

from react-native-document-scanner-plugin.

ospfranco avatar ospfranco commented on July 26, 2024

I would still argue loading a 100mb photo is not ideal... considering a normal jpeg is 4 mbs. I can definitely see lower end android devices still crashing.

from react-native-document-scanner-plugin.

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.