dims

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleDimsStatus

func HandleDimsStatus(config core.Config, w http.ResponseWriter, r *http.Request)

func Handler

func Handler(request RequestContext) error

Types

type Headers added in v0.5.0

type Headers interface {
	Etag() string
	LastModified() string
	Expires() string
	CacheControl() string
	EdgeControl() string
	ContentDisposition() string
}

type Request

type Request struct {
	URL                    *url.URL          // The URL of the http.
	ImageUrl               string            // The image URL that is being manipulated.
	SendContentDisposition bool              // The content disposition of the http.
	RawCommands            string            // The commands ('resize/100x100', 'strip/true/format/png', etc).
	Signature              string            // The signature of the request.
	SignedParams           map[string]string // The query parameters used to sign the request.
	SourceImage            core.Image        // The source image.
	// contains filtered or unexported fields
}

func NewRequest added in v0.5.0

func NewRequest(url *url.URL, cmds string, config core.Config) (*Request, error)

func (*Request) Commands

func (r *Request) Commands() []commands.Command

func (*Request) Config

func (r *Request) Config() core.Config

func (*Request) FetchImage

func (r *Request) FetchImage(timeout time.Duration) (*core.Image, error)

func (*Request) LoadImage added in v0.4.0

func (r *Request) LoadImage(sourceImage *core.Image) (*vips.ImageRef, error)

func (*Request) ProcessImage

func (r *Request) ProcessImage(image *vips.ImageRef, errorImage bool) (string, []byte, error)

ProcessImage will execute the commands on the image.

type RequestContext added in v0.5.0

type RequestContext interface {
	Headers
	Config() core.Config
	Validate() bool
	FetchImage(timeout time.Duration) (*core.Image, error)
	LoadImage(image *core.Image) (*vips.ImageRef, error)
	ProcessImage(img *vips.ImageRef, strip bool) (string, []byte, error)
	SendImage(status int, imageFormat string, imageBlob []byte) error
}

Jump to

Keyboard shortcuts

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