ximg

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: MIT Imports: 27 Imported by: 0

README

ximage

exif 信息写入依赖 exiftool

# mac 
brew install exiftool

# linux
sudo apt-get install exiftool

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode added in v0.0.7

func Base64Decode(encoded string, filepath string) error

Base64Decode ...

func Base64Encode added in v0.0.7

func Base64Encode(filepath string) string

Base64Encode ...

func Border added in v0.0.7

func Border(src image.Image, width int, colors ...string) image.Image

Border 外边框

func Circle added in v0.0.7

func Circle(src image.Image) image.Image

Circle 圆形

func Compress added in v0.0.7

func Compress(fpath string, quality int) (image.Image, error)

Compress 图片压缩, quality 取值范围 1-100

func CompressJPEG added in v0.0.7

func CompressJPEG(src image.Image, quality int) (image.Image, error)

CompressJPEG ...

func CompressPNG added in v0.0.7

func CompressPNG(src image.Image, quality int) (image.Image, error)

CompressPNG 依赖 pngquant

func Download added in v0.0.8

func Download(ctx context.Context, imgURL, imgPath string) error

Download ...

func Parse

func Parse(filepath string) (image.Image, string, error)

Parse ...

func Read

func Read(filepath string) image.Image

Read ...

func ReadExif

func ReadExif(filepath string) map[string]interface{}

ReadExif ...

func Resize added in v0.0.7

func Resize(src image.Image, w, h int) image.Image

Resize ...

func Rounded added in v0.0.7

func Rounded(src image.Image, p float64) image.Image

Rounded 圆角处理 p: 圆角率, 范围 0 - 1, 默认 0.25

func Size

func Size(filepath string) (int, int)

Size ...

func ToIco added in v0.0.7

func ToIco(srcPath, dstPath string, sizes ...int) error

ToIco 图片转 ico, sizes 默认 256*256

func Type

func Type(filepath string) string

Type ...

func WatermarkImage added in v0.0.7

func WatermarkImage(src, w image.Image, p image.Point) image.Image

WatermarkImage ...

func WatermarkText added in v0.0.7

func WatermarkText(src image.Image, text string, color string, size, x, y float64) image.Image

WatermarkText ...

func Write

func Write(filepath string, src image.Image) error

Write ...

func WriteExif

func WriteExif(filepath string, kv map[string]string) error

WriteExif ... key 须是有效的 exif 字段

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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