manuels/unix-toolbox.js-exact-image

Out of memory on iOS 6

gamergemparq opened this issue · 3 comments

Hi Manuel,

Really loves your barcode scanner. But unfortunately I had issue with my iOS 6 device. Please advice.

Replication method:

  1. Load demo site [http://manuels.github.io/unix-toolbox.js-exact-image/demo/] in Safari iOS 6
  2. Took a picture.
  3. Saw this error: result: Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.: undefined

You photo is probably too large.
Can you resize it (e.g. using a canvas) and run it can?

Hi Manuels,

Thanks for lending your time for this :D

I tried scaling down the image to 320x240px using CANVAS's scale() and then converts it to a blob using canvas.toBlob() method, but when passing the blob to the addData() function, nothing happens, visually.

So then I compared the print out of the binary data from my canvas attempt to the binary data of the unscaled/original uploaded file, and they look different. Not sure if CANVAS add extra stuff to the binary data, which makes it not working properly?

Your advise is appreciated.

Hi and happy new year!

So then I compared the print out of the binary data from my canvas attempt to the binary data of the unscaled/original uploaded file, and they look different

do you still get the out of memory error with the scaled down version? can you post this output here?