optimizer

package module
v0.0.0-...-c7e8d06 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: MPL-2.0 Imports: 11 Imported by: 3

README

GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, i image.Image, o Options) error

Encode encodes the image with the given options.

Types

type Options

type Options struct {
	Mime          string
	Width         uint
	Height        uint
	Dpr           float64
	Quality       int
	Downlink      float64
	ViewportWidth float64
	SaveData      bool
	Interpolation resize.InterpolationFunction
	Optimized     bool
}

Options provides a Client-Hinting compatible set of options for image encoding.

func (*Options) Optimize

func (o *Options) Optimize()

Optimize sets the Quality dependent on various factors

func (*Options) SetFromRequest

func (o *Options) SetFromRequest(r *http.Request)

SetFromRequest sets the options based on headers/parameters in the http request

Jump to

Keyboard shortcuts

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