imageoutput

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: MIT Imports: 12 Imported by: 0

README

imageoutput

Generic image output library.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JPEGFile

type JPEGFile struct {
	Directory string
	Width     int
	Height    int
	Quality   float32
}

JPEGFile ...

func (*JPEGFile) Delete

func (output *JPEGFile) Delete(baseName string) error

Delete deletes the file from the file system.

func (*JPEGFile) Save

func (output *JPEGFile) Save(avatar *MetaImage, baseName string) error

Save writes the image in JPEG format to the file system.

type MetaImage

type MetaImage struct {
	Image  image.Image
	Data   []byte
	Format string
}

MetaImage represents a single image with the name of the format and the original byte buffer.

func (*MetaImage) Extension

func (avatar *MetaImage) Extension() string

Extension returns the file extension of the image.

func (*MetaImage) String

func (avatar *MetaImage) String() string

String returns a text representation of the format, width and height.

type OriginalFile

type OriginalFile struct {
	Directory string
	Width     int
	Height    int
}

OriginalFile ...

func (*OriginalFile) Delete

func (output *OriginalFile) Delete(baseName string) error

Delete deletes the file from the file system.

func (*OriginalFile) Save

func (output *OriginalFile) Save(avatar *MetaImage, baseName string) error

Save writes the original avatar to the file system.

type Output

type Output interface {
	Save(img *MetaImage, baseName string) error
	Delete(baseName string) error
}

Output represents a system that saves an image locally (in database or as a file, e.g.)

type WebPFile

type WebPFile struct {
	Directory string
	Width     int
	Height    int
	Quality   float32
}

WebPFile ...

func (*WebPFile) Delete

func (output *WebPFile) Delete(baseName string) error

Delete deletes the file from the file system.

func (*WebPFile) Save

func (output *WebPFile) Save(avatar *MetaImage, baseName string) error

Save writes the image in WebP format to the file system.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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