himage

package module
v0.0.0-...-1931644 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 11 Imported by: 0

README

himage

Basic image helpers

Installation

go get -u github.com/streetbyters/himage

Examples


Thanks

LICENSE

Copyright 2021 StreetByters Community <github.com/streetbyters>
MIT LICENSE

Documentation

Index

Constants

View Source
const (
	// CHUNK_SIZE default file operation chunk size
	CHUNK_SIZE int = 32 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor int

Anchor is the anchor point for image alignment. It has been taken from the repo github.com/disintegration/imaging for easy access to the package.

const (
	Center Anchor = iota
	TopLeft
	Top
	TopRight
	Left
	Right
	BottomLeft
	Bottom
	BottomRight
)

Anchor point positions. It has been taken from the repo github.com/disintegration/imaging for easy access to the package.

type Himage

type Himage struct {
	Multipart *multipart.FileHeader
	File      *os.File
	Error     error
	Detail    struct {
		Width  int
		Height int
		Mime   string
		Size   int64
	}
	// contains filtered or unexported fields
}

Himage ..

func NewHimageWithFile

func NewHimageWithFile(f *os.File) *Himage

NewHimageWithFile ..

func NewHimageWithMultipart

func NewHimageWithMultipart(f *multipart.FileHeader) *Himage

NewHimageWithMultipart ..

func NewHimageWithPath

func NewHimageWithPath(p string) *Himage

NewHimageWithPath ..

func (*Himage) Move

func (i *Himage) Move() *Himage

Move ..

func (*Himage) RemoveOrigin

func (i *Himage) RemoveOrigin(val bool) *Himage

RemoveOrigin ..

func (*Himage) Resize

func (i *Himage) Resize(option Resize) *Himage

Resize ..

func (*Himage) Run

func (i *Himage) Run() (*Himage, error)

Run ..

func (*Himage) SetDestination

func (i *Himage) SetDestination(p string) *Himage

SetDestination ..

func (*Himage) SetName

func (i *Himage) SetName(name string) *Himage

SetName ..

func (*Himage) SetQuality

func (i *Himage) SetQuality(q interface{}) *Himage

SetQuality ..

type Resize

type Resize struct {
	Anchor         Anchor
	Ratio          int
	Width          int
	Height         int
	WidthOriented  bool
	HeightOriented bool
	Maximize       bool
	Minimize       bool
}

Resize ..

func (Resize) Valid

func (r Resize) Valid() error

Valid ..

Jump to

Keyboard shortcuts

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