Documentation
¶
Index ¶
- Constants
- type Converter
- func (c *Converter) Cancel()
- func (c *Converter) Convert(fileName string, fileInfo os.FileInfo) error
- func (c *Converter) Cover(fileName string, fileInfo os.FileInfo) error
- func (c *Converter) Files(args []string) ([]File, error)
- func (c *Converter) Initialize()
- func (c *Converter) Meta(fileName string) (any, error)
- func (c *Converter) Preview(fileName string, fileInfo os.FileInfo, width, height int) (Image, error)
- func (c *Converter) Terminate()
- func (c *Converter) Thumbnail(fileName string, fileInfo os.FileInfo) error
- type File
- type Image
- type Options
Constants ¶
View Source
const ( // NearestNeighbor is the fastest resampling filter, no antialiasing. NearestNeighbor int = iota // Box filter (averaging pixels). Box // Linear is the bilinear filter, smooth and reasonably fast. Linear // MitchellNetravali is a smooth bicubic filter. MitchellNetravali // CatmullRom is a sharp bicubic filter. CatmullRom // Gaussian is a blurring filter that uses gaussian function, useful for noise removal. Gaussian // Lanczos is a high-quality resampling filter, it's slower than cubic filters. Lanczos )
Resample filters.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶ added in v1.0.4
type Converter struct {
// Options struct
Opts Options
// Current working directory
Workdir string
// Number of files
Nfiles int
// Index of current file
CurrFile int
// Number of contents in archive/document
Ncontents int
// Index of current content
CurrContent int32
// Start function
OnStart func()
// Progress function
OnProgress func()
// Compress function
OnCompress func()
// Cancel function
OnCancel func()
}
Converter type.
func (*Converter) Cancel ¶ added in v1.0.4
func (c *Converter) Cancel()
Cancel cancels the operation.
func (*Converter) Initialize ¶ added in v1.0.4
func (c *Converter) Initialize()
Initialize inits ImageMagick.
func (*Converter) Preview ¶ added in v1.0.4
func (c *Converter) Preview(fileName string, fileInfo os.FileInfo, width, height int) (Image, error)
Preview returns image preview.
type Options ¶
type Options struct {
// Image format, valid values are jpeg, png, tiff, bmp, webp, avif, jxl
Format string
// Archive format, valid values are zip, tar
Archive string
// JPEG image quality
Quality int
// Image width
Width int
// Image height
Height int
// Best fit for required width and height
Fit bool
// 0=NearestNeighbor, 1=Box, 2=Linear, 3=MitchellNetravali, 4=CatmullRom, 6=Gaussian, 7=Lanczos
Filter int
// Do not convert the cover image
NoCover bool
// Do not convert images that have RGB colorspace
NoRGB bool
// Remove non-image files from the archive
NoNonImage bool
// Do not transform or convert images
NoConvert bool
// Add suffix to file baseNoExt
Suffix string
// Extract cover
Cover bool
// Extract cover thumbnail (freedesktop spec.)
Thumbnail bool
// CBZ metadata
Meta bool
// Version
Version bool
// ZIP comment
Comment bool
// ZIP comment body
CommentBody string
// Add file
FileAdd string
// Remove file
FileRemove string
// Output file
OutFile string
// Output directory
OutDir string
// Convert images to grayscale (monochromatic)
Grayscale bool
// Rotate images, valid values are 0, 90, 180, 270
Rotate int
// Adjust the brightness of the images, must be in the range (-100, 100)
Brightness int
// Adjust the contrast of the images, must be in the range (-100, 100)
Contrast int
// Process subdirectories recursively
Recursive bool
// Process only files larger than size (in MB)
Size int
// Hide console output
Quiet bool
// Shadow input value
LevelsInMin int
// Highlight input value
LevelsInMax int
// Midpoint/gamma
LevelsGamma float64
// Shadow output value
LevelsOutMin int
// Highlight output value
LevelsOutMax int
}
Options type.
Click to show internal directories.
Click to hide internal directories.
