encoder

package
v1.4.23 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode(m image.Image, w http.ResponseWriter) error
}

Encoder describes any type that can encode with the image and response writer.

func Get

func Get(format string, r *http.Request) Encoder

Get parses the `format` query variable and uses it to see if the user has specified the output format, otherwise, it tries to see if it can encode the image with the source format, otherwise, it just encodes it as "jpeg".

type WrapEncoderFunc

type WrapEncoderFunc func(m image.Image, w http.ResponseWriter) error

WrapEncoderFunc type is an adapter to allow the use of ordinary functions as image Encoders. If f is a function with the appropriate signature, WrapEncoderFunc(f) is a Encoder that calls f.

func (WrapEncoderFunc) Encode

Encode calls f(m, w).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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