imagedata

package
v3.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSourceFileTooBig            = ierrors.New(422, "Source image file is too big", "Invalid source image")
	ErrSourceImageTypeNotSupported = ierrors.New(422, "Source image type not supported", "Invalid source image")
)

Functions

func Init

func Init() error

func RedirectAllRequestsTo

func RedirectAllRequestsTo(u string)

func StopRedirectingRequests

func StopRedirectingRequests()

Types

type ErrorNotModified

type ErrorNotModified struct {
	Message string
	Headers map[string]string
}

func (*ErrorNotModified) Error

func (e *ErrorNotModified) Error() string

type ImageData

type ImageData struct {
	Type    imagetype.Type
	Data    []byte
	Headers map[string]string
	// contains filtered or unexported fields
}
var (
	Watermark     *ImageData
	FallbackImage *ImageData
)

func Download

func Download(imageURL, desc string, header http.Header, jar *cookiejar.Jar) (*ImageData, error)

func FromBase64

func FromBase64(encoded, desc string) (*ImageData, error)

func FromFile

func FromFile(path, desc string) (*ImageData, error)

func (*ImageData) Close

func (d *ImageData) Close()

func (*ImageData) SetCancel

func (d *ImageData) SetCancel(cancel context.CancelFunc)

Jump to

Keyboard shortcuts

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