Git Product home page Git Product logo

Comments (11)

Maniak82 avatar Maniak82 commented on July 19, 2024

Could be related to this issue : #27

from jsqrcode.

rmmoriya avatar rmmoriya commented on July 19, 2024

the errors is in the archive findpat
this.selectBestPatterns = function()
{
var startSize = this.possibleCenters.length;

i don't know whats the problem.

from jsqrcode.

Maniak82 avatar Maniak82 commented on July 19, 2024

I have had the same error at the same line. Please see my comment on #27 . Here there is a solution http://stackoverflow.com/a/17086329. This is an iOS know bug, image taken by camera are squashed vertically, and need to be resized before used.
I have modified 'qrcode.js' to use these two functions from stackoverflow, replaced context.drawImage() call by drawImageIOSFix() and it's work for me.

from jsqrcode.

rmmoriya avatar rmmoriya commented on July 19, 2024

Thanks, i will try!

from jsqrcode.

rmmoriya avatar rmmoriya commented on July 19, 2024

i've been tryed and i have no success with iphone5.
Can you send me a example for your code?

from jsqrcode.

rmmoriya avatar rmmoriya commented on July 19, 2024

The problem that i have is not about show image... is about decode ... in iphone5 show the message error decode QR code... and in my galaxy s3 i don't have problems...
I send the picture to iphone that i took in my galaxy s3 and iphone read.....
Just when i take a photo in iphone it doesn't work

from jsqrcode.

Maniak82 avatar Maniak82 commented on July 19, 2024

Yeah that what I say, the problem come from the iphone camera somewhere returning wrong image size and then posing problem when trying to decode QR code.

In qrcode.js, try to add the two stackoverflow functions (detectVerticalSquash(), drawImageIOSFix(), see my previous comment) and then replace in qrcode.decode (still in qrcode.js) "context.drawImage(image, 0, 0, canvas_qr.width, canvas_qr.height );" by "drawImageIOSFix(context, image, 0, 0, image.width, image.height, 0, 0, nwidth, nheight);"

That should work, I have had exactly the same behavior as you, photo coming from another source work, photo taken from iphone doesn't.

from jsqrcode.

rmmoriya avatar rmmoriya commented on July 19, 2024

Thankksssss a lotttt mannnn!!!!!! It worksss!!!!

from jsqrcode.

Maniak82 avatar Maniak82 commented on July 19, 2024

You are welcome !

from jsqrcode.

ckinan avatar ckinan commented on July 19, 2024

Thank you sooooo much!!!!
I was looking for the solution to solve this problem..!
Finally, I found it!
It really works!!!
Thanksss!!!!

from jsqrcode.

rickreyhsig avatar rickreyhsig commented on July 19, 2024

Hum geez, I did this, and my picture is being squashed in the drawImage process.
I have a button which is triggered that calls drawImageIOSFix. Any ideas?

$("#getQr").bind('touchstart', function(e) {
var img = document.getElementById('img');
var canvas = document.getElementById('qr-canvas'); // reference to canvas element
var ctx = canvas.getContext('2d'); // get the canvas context;
drawImageIOSFix(ctx, img, 0, 0, img.width, img.height);
readQR();
});

from jsqrcode.

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.