optimizer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageFormat

type ImageFormat string

ImageFormat represents supported image formats

const (
	FormatJPEG ImageFormat = "jpeg"
	FormatPNG  ImageFormat = "png"
	FormatWebP ImageFormat = "webp"
	FormatSVG  ImageFormat = "svg"
)

type Result

type Result struct {
	// Original file path
	FilePath string

	// File type (jpg, png, svg)
	FileType string

	// Original file size in bytes
	OriginalSize int64

	// Processed file size in bytes
	ProcessedSize int64

	// Bytes saved
	BytesSaved int64

	// Output file path
	OutputPath string

	// Whether processing was successful
	Success bool

	// Error message if processing failed
	Error string
}

Result represents the outcome of processing a file

func ProcessImage

func ProcessImage(inputPath string, outputDir string, opts config.Options, dryRun bool) Result

ProcessImage handles JPEG and PNG compression and conversion

func ProcessSVG

func ProcessSVG(inputPath string, outputDir string, dryRun bool) Result

ProcessSVG handles SVG minification

Jump to

Keyboard shortcuts

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