gozbarlib

package module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 4 Imported by: 0

README

gozbarlib: 系统调用zbarimg解析二维码

解析二维码

通过系统调用zbarimg, 解析二维码图片

示例:

package main

import (
	"fmt"
	"github.com/frkhit/gozbarlib"
)

func main() {
	content, err := gozbarlib.QRCodeReader("xx.png")
	if err!=nil{
		panic(err)
	}
	fmt.Println("content of image is :", content)
}

安装

windows系统下安装

  • 安装目录下的zbar-0.10-setup.exe程序 最新版本
  • zbarimg.exe所在目录添加至系统PATH
  • 安装成功: cmd下执行zbarimg.exe, 确定是否安装成功

linux下安装

  • 安装zbar: sudo apt install libzbar-dev zbar-tools -f -y
  • 安装成功: terminal执行zbarimg确定是否安装成功

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultQRTool = &QRTool{libPath: ""}

Functions

func QRCodeReader

func QRCodeReader(imagePath string) (string, error)

Types

type QRTool

type QRTool struct {
	// contains filtered or unexported fields
}

func (*QRTool) FindLibPath

func (qr *QRTool) FindLibPath() (string, error)

func (*QRTool) QRCodeReader

func (qr *QRTool) QRCodeReader(imagePath string) (string, error)

func (*QRTool) SetLibPath

func (qr *QRTool) SetLibPath(libPath string)

Directories

Path Synopsis
cmd/grcode command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL