convert

package
v0.0.0-...-e135e79 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedContentType = errors.New("unsupported content-type")

ErrUnsupportedContentType is used when the given content type is not supported.

Functions

func Convert

func Convert(config *Config, r io.Reader, w io.Writer) error

Convert reads, decodes and resizes the given image. Then, the image gets encoded and written.

Types

type Config

type Config struct {
	Width           int
	Height          int
	Quality         int
	ContentTypeFrom string
	ContentTypeTo   string
}

Config is used to specify the type of conversion to be made.

func ParseHTTPRequest

func ParseHTTPRequest(r *http.Request) (*Config, error)

ParseHTTPRequest parses a http.Request and constructs a Config.

Jump to

Keyboard shortcuts

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