Documentation
¶
Index ¶
- 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) Meta(fileName string) (any, error)
- func (c *Converter) Preview(fileName string, fileInfo os.FileInfo, width, height int) (Image, error)
- func (c *Converter) Thumbnail(fileName string, fileInfo os.FileInfo) error
- type File
- type Image
- type Options
Constants ¶
This section is empty.
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.
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
}
Options type.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.