converter

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConversionResult

type ConversionResult struct {
	OriginalPath string
	NewPath      string
	OriginalSize int64
	NewSize      int64
	Duration     time.Duration
	Error        error
}

ConversionResult holds the outcome of a single image conversion.

type ConvertOptions

type ConvertOptions struct {
	Quality      uint16
	MaxDimension uint16
	KeepOriginal bool
	DryRun       bool
	Backup       bool
}

ConvertOptions contains the settings for the image conversion process.

type ImageConverter

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

ImageConverter is responsible for converting images.

func NewImageConverter

func NewImageConverter(options ConvertOptions) *ImageConverter

NewImageConverter returns a new ImageConverter instance.

func (*ImageConverter) Convert

func (ic *ImageConverter) Convert(path string, format string) *ConversionResult

Convert converts the image at the given path to the given format.

func (*ImageConverter) ConvertWithOutputPath added in v1.5.4

func (ic *ImageConverter) ConvertWithOutputPath(path string, format string, outputPath string) *ConversionResult

ConvertWithOutputPath converts the image at the given path to the given format with a custom output path.

Jump to

Keyboard shortcuts

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