compressor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compressor

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

Compressor 图片压缩器

func New

func New(logger *zap.Logger, preset dto.Preset, outputDir string, keepStruct bool, maxWidth, maxHeight int) *Compressor

New 创建新的压缩器

func (*Compressor) Process

func (c *Compressor) Process(ctx context.Context, job *dto.FileJob) (*dto.FileJob, error)

Process 处理单个文件

func (*Compressor) ProcessToFile

func (c *Compressor) ProcessToFile(src, dst string) error

ProcessToFile 处理单个文件(简化接口)

type PresetConfig

type PresetConfig struct {
	JPEGQuality int
	WebPQuality int
	PNGLevel    int
}

PresetConfig 预设配置

Jump to

Keyboard shortcuts

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