Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pixbooster ¶
type Pixbooster struct {
// Path where to store the modern image files. Optional.
Storage string `json:"storage,omitempty"`
// Disable Webp output if present.
Nowebpoutput bool `json:"nowebpoutput,omitempty"`
// Disable treatment of Webp files in the incomming HTML if present.
Nowebpinput bool `json:"nowebpinput,omitempty"`
// Disable Avif output if present.
Noavif bool `json:"noavif,omitempty"`
// Disable JXL output if present.
Nojxl bool `json:"nojxl,omitempty"`
// Disable treatment of JPEG files in the incomming HTML if present.
Nojpeg bool `json:"nojpeg,omitempty"`
// Disable treatment of PNG files in the incomming HTML if present.
Nopng bool `json:"nopng,omitempty"`
// Quality of output pictures, a integer between 0 and 100. Optional.
Quality int `json:"quality,omitempty"`
// Set specific Webp ouput options.
WebpConfig WebpConfig `json:"webp_config,omitempty"`
// Set specific Avif ouput options.
AvifConfig avif.Options `json:"avif_config,omitempty"`
// Set specific JXL ouput options.
JxlConfig jpegxl.Options `json:"jxl_config,omitempty"`
// contains filtered or unexported fields
}
Pixbooster allows your server to provide pictures in modern file formats (webp, avif, jxl) on the fly without requiring you to change your html.
func (Pixbooster) CaddyModule ¶
func (Pixbooster) CaddyModule() caddy.ModuleInfo
func (Pixbooster) ServeHTTP ¶
func (p Pixbooster) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
func (*Pixbooster) UnmarshalCaddyfile ¶
func (p *Pixbooster) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler. Syntax:
pixbooster [nowebpoutput|noavif|nojxl|nojpg|nopng] {
[nowebpoutput|noavif|nojxl|nojpg|nopng]
quality <integer between 0 and 100>
storage <directory> Path to the directory where to store generated picture files
webp {
quality <integer between 0 and 100>
lossless
exact
}
avif {
quality <integer between 0 and 100>
qualityalpha <integer between 0 and 100>
speed <integer between 0 and 10>
}
jxl {
quality <integer between 0 and 100>
effort <integer between 0 and 10>
}
}
The 'quality' value is inherited by webp.quality, avif.quality, and jxl.quality if not specified. The 'speed' and 'effort' values should be integers between 0 and 10. The 'lossless' and 'exact' flags are set to true if specified. All directives are optional.
type WebpConfig ¶ added in v0.1.2
Click to show internal directories.
Click to hide internal directories.