image

package
v0.0.0-...-9afc673 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2017 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadJob

type DownloadJob struct {
	SourceURL      string
	SourcePath     string
	TargetDir      string
	TargetFilename string
}

DownloadJob Master image download definition

func (*DownloadJob) Process

func (job *DownloadJob) Process() error

Process Do master image download and remove temporary file on process error

type Job

type Job struct {
	RequestHash string `json:"-"`
	MasterDir   string `json:"-"`
	ResultDir   string `json:"-"`
	SourceURL   string `json:"-"`
	SourcePath  string `json:"source_path"`
	Params      Params `json:"image_params,omitempty"`
}

Job Main job for image transformation Ccontain basic info for source file and requested params

func (*Job) Process

func (job *Job) Process() error

Process Do image processing from downloading to vips process via bimg

type Params

type Params struct {
	Width   int                 `json:"w,omitempty"`
	Height  int                 `json:"h,omitempty"`
	Quality int                 `json:"q,omitempty"`
	Blur    int                 `json:"blur,omitempty"`
	Flip    bool                `json:"flip,omitempty"`
	Flop    bool                `json:"flop,omitempty"`
	Colour  bimg.Interpretation `json:"c,omitempty"`
	Format  bimg.ImageType      `json:"fmt,omitempty"`
	Fit     string              `json:"fit,omitempty"`
}

Params Supported request params for transformation

func ValidateParams

func ValidateParams(query url.Values) Params

ValidateParams Validate requested query parameters

Jump to

Keyboard shortcuts

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