image

package
v0.0.0-...-1913e9d Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageConfig

func GetImageConfig(pth string) (image.Config, string, error)

func GetImageFromFile

func GetImageFromFile(pth string) (image.Image, string, error)

func IsImage

func IsImage(filename string) bool

IsImage checks the file's extention to determine whether the file is an image type. TODO: Add FileType() by checking the file content instead just extension. IsImage() is just one case of it.

func IsImageExt

func IsImageExt(ext string) bool

IsImageExt checks the file's extention to determine whether the file is an image type.

func MimeFromIncipit

func MimeFromIncipit(b []byte) string

mimeFromIncipit returns the mime type of an image file from its first few bytes or the empty string if the file does not look like a known file type

func WriteImageToBytes

func WriteImageToBytes(img image.Image, format string) ([]byte, error)

func WriteImageToFile

func WriteImageToFile(img image.Image, format, pth string, mode os.FileMode) error

Types

type ImageInfo

type ImageInfo struct {
	Image  image.Image
	Format string
	Config image.Config
	Size   int
}

func GetImageInfo

func GetImageInfo(pth string) (*ImageInfo, error)

Jump to

Keyboard shortcuts

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