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.
Click to show internal directories.
Click to hide internal directories.