Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QRCode oversize #11

Closed
tentenlee100 opened this issue May 10, 2017 · 12 comments
Closed

QRCode oversize #11

tentenlee100 opened this issue May 10, 2017 · 12 comments

Comments

@tentenlee100
Copy link

使用1.2.4版本 使用example裡面的程式直接建立qrcode整個qrcode就跑掉了,只會顯示一個區塊而已
再麻煩看一下,

ios版本是9.3 iphone 6

screen shot 2017-05-10 at 21 58 59

@EyreFree
Copy link
Member

你好:

  1. 可以提供一下具体生成参数么?
  2. 然后保存到相册能否查看到完整二维码图片?

@tentenlee100
Copy link
Author

@EyreFree
直接整包zip下載解開後,直接run參數都不改,就變這樣,存下來也一樣是長這樣

@EyreFree
Copy link
Member

我这里目前无法复现该问题,能否麻烦将 watermark 参数设为 WWF 然后将生成页面截图给我看一下?

@tentenlee100
Copy link
Author

tentenlee100 commented May 11, 2017

@EyreFree
換了一支手機後就正常
會出問題的目前只遇到iphone6 上 9.3.5(實機)
請問wwf是什麼東西呀?

是這樣嗎?
screen shot 2017-05-11 at 15 17 30

@EyreFree
Copy link
Member

EyreFree commented May 11, 2017

唔,这个也行...

虽然还是看不出啥问题,😂

我去下个 9.3.5 模拟器看看...


感谢反馈,🙏

@tentenlee100
Copy link
Author

@EyreFree
模擬器正常,我測試過了,所以我才說實機才有這問題,不確定是否是只有我這隻手機才有問題而已....

@EyreFree
Copy link
Member

那这就很尴尬了...

目前没发现有设备能复现的...

😂

@tentenlee100
Copy link
Author

@EyreFree
最後我用以前我自己以前寫的程式跑就正常,給你參考看看

func getQrcodeImage(qrcodeString:String) -> UIImage?{
        guard  let qrFilter = CIFilter(name:"CIQRCodeGenerator") else {
            return nil
        }
        qrFilter.setDefaults()
        
        guard let infoData = qrcodeString.data(using: String.Encoding.utf8) else {
            return nil
        }
        qrFilter.setValue(infoData, forKey: "inputMessage")
        
        guard let ciImage = qrFilter.outputImage else {
            return nil
        }
        
        let cgImage = CIContext(options:nil).createCGImage(ciImage, from: ciImage.extent)
        
        let qrcodeImage = UIImage(cgImage:cgImage!)
        
        let imageWidth : CGFloat = 240.0
        
        UIGraphicsBeginImageContext(CGSize(width: imageWidth, height: imageWidth))
        
        let  resizeContext = UIGraphicsGetCurrentContext();
        resizeContext!.interpolationQuality = CGInterpolationQuality.none;
        
        qrcodeImage.draw(in: CGRect(x: 0.0 , y: 0.0 ,width: imageWidth , height:  imageWidth))
        let resizedImage = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext();
        
        return resizedImage
        
        
    }

@EyreFree
Copy link
Member

好的,感谢,🙏

@nbbug
Copy link

nbbug commented May 17, 2017

我ios10的手机没事,iOS9的ipad和他一样有这个问题

@EyreFree EyreFree changed the title qrcode oversize Qrcode oversize May 19, 2017
@EyreFree EyreFree changed the title Qrcode oversize QRCode oversize May 19, 2017
@Zrocky
Copy link

Zrocky commented May 23, 2017

iOS 9.3.4 iPod真机 发生同样错误,测试过模拟器iOS9完全正常
img_0247

EyreFree pushed a commit that referenced this issue May 23, 2017
@EyreFree EyreFree mentioned this issue May 24, 2017
@EyreFree
Copy link
Member

@tentenlee100 @chenggc @Zrocky

Fixed in 1.2.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants