Git Product home page Git Product logo

Comments (5)

vin-zhou avatar vin-zhou commented on September 7, 2024 1

@EyreFree do "binarization" is to set the image just in black/white 2 colors, the CGImage.binarization() doesn't work since it use foreground/background color, is it right?

@Jacklchen I also found for some color (such as blue) in kCGColorSpaceDeviceGray only contains 2 components, so the init may also wrongly return nil.

from efqrcode.

arlovip avatar arlovip commented on September 7, 2024

I also found this. So fork the repository and fix it with return keyword for EFDefine.swift @EyreFree


public struct EFUIntPixel {
    public var red: UInt8 = 0
    public var green: UInt8 = 0
    public var blue: UInt8 = 0
    public var alpha: UInt8 = 0

    init(red: UInt8, green: UInt8, blue: UInt8, alpha: UInt8) {
        self.red = red
        self.green = green
        self.blue = blue
        self.alpha = alpha
    }

    init?(color: CGColor) {
        if let components = color.components, 4 == color.numberOfComponents {
            self.init(
                red: UInt8(components[0] * 255.0),
                green: UInt8(components[1] * 255.0),
                blue: UInt8(components[2] * 255.0),
                alpha: UInt8(components[3] * 255.0)
            )
            return
        }
        return nil
    }
}

from efqrcode.

arlovip avatar arlovip commented on September 7, 2024

yeah. Hope that EyreFree will fix it soon.

from efqrcode.

ApolloZhu avatar ApolloZhu commented on September 7, 2024

@vin-zhou @LegendChan please check to see if the master branch have fixed the problem.

from efqrcode.

ApolloZhu avatar ApolloZhu commented on September 7, 2024

We assume the bug is fixed. If it's still not working for you, leave a comment or discuss in the QQ group.

from efqrcode.

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.