utils

package
v0.0.0-...-88c3b2e Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesFromString

func BytesFromString(s string) (int64, error)

Convert human readable string to bytes. 1k string -> 1024 int

func HumanBytes

func HumanBytes(size int64) (result string)

Convert bytes to human readable string. Like a 2 MiB, 64.2 KiB, 52 B

Types

type Image

type Image struct {
	Filename string
	Type     string
	Width    int
	Height   int
}

func Identify

func Identify(filename string) (*Image, error)

func (*Image) Crop

func (i *Image) Crop(dst, format string, w, h, q int, optimize bool) error

func (*Image) Resize

func (i *Image) Resize(dst, format string, w, h, q int, optimize bool) error

Jump to

Keyboard shortcuts

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