ocr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:    "ocr",
	Usage:   "图片识别文字",
	Aliases: []string{"o"},
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "filename",
			Aliases: []string{"f"},
			Usage:   "图片文件名",
			Action: func(context *cli.Context, s string) error {
				if _, err := os.Stat(s); os.IsNotExist(err) {
					return fmt.Errorf("文件 %s 不存在,请重新选择文件", s)
				}

				ext := filepath.Ext(s)
				if common.Identify(ext) == false {
					return fmt.Errorf(common.ExtError)
				}

				return nil
			},
		},
	},
	Action: Action,
}

Functions

func Action

func Action(c *cli.Context) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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