img

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resize added in v1.0.1

func Resize(ro ResizeOptions) error

Resize 根据提供的 ResizeOptions 调整图像大小

func ToBase64 added in v1.0.1

func ToBase64(imgPath string) (string, error)

func WriteBase64ToFile added in v1.0.1

func WriteBase64ToFile(base64Str, fullPath string, overwrite bool) error

WriteBase64ToFile 将Base64编码的图片字符串写入文件

Types

type Info

type Info struct {
	Width    int    `json:"width"`
	Height   int    `json:"height"`
	Format   string `json:"format"`
	Ext      string `json:"ext"`
	Size     int64  `json:"size"`
	FileName string `json:"filename"`
	FileMD5  string `json:"file_md5"`
}

func GetInfo added in v1.0.1

func GetInfo(path string, withMd5 bool) (*Info, error)

type ResizeOptions

type ResizeOptions struct {
	Src      string
	SavePath string
	Width    int
	Height   int
	Quality  int
}

ResizeOptions 定义了 Resize 方法的参数

Jump to

Keyboard shortcuts

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