manuels / unix-toolbox.js-exact-image

ExactImage's bardecode ported to JS
http://manuels.github.com/unix-toolbox.js
61 stars 21 forks source link

Out of memory on iOS 6 #4

Open gamergemparq opened 10 years ago

gamergemparq commented 10 years ago

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
manuels commented 10 years ago

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

gamergemparq commented 10 years ago

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.

manuels commented 10 years ago

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?