Giter Club home page Giter Club logo

Comments (2)

caixw avatar caixw commented on June 5, 2024

运行go test能在目录下正常产生测试图像吗?

from identicon.

insionng avatar insionng commented on June 5, 2024

抱歉,是我直接抄你的示例造成的错,把前后景的空color.NRGBA{}照复制进去了,此问题可以关闭了.

另外,go test 也可以生成77张测试图片,结果是ok 和pass.

package main

import (
    "fmt"
    "github.com/issue9/identicon"
    "image/color"
    "image/png"
    "os"
)

func main() {
    //img, e := identicon.Make(256, color.NRGBA{}, color.NRGBA{}, []byte("YouGam!"))

    img, e := identicon.Make(256, color.RGBA{255, 0, 0, 100}, color.RGBA{0, 255, 255, 100}, []byte("YouGam"))
    if e != nil {
        fmt.Println(e)
        return
    }

    fi, e := os.Create("img.png")
    if e != nil {
        fmt.Println(e)
        return
    }
    defer fi.Close()

    png.Encode(fi, img)
}

from identicon.

Related Issues (5)

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.