imagemeta

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFormat = errors.New("unknown image format")
)
View Source
var ErrWebpInvalidFormat = errors.New("webp: invalid format")

Functions

func BestIcoPage

func BestIcoPage(r io.Reader) (int, int, error)

func FixBmpHeader

func FixBmpHeader(b []byte) ([]byte, error)

FixBmpHeader fixes an incomplete header of BMP stored in ICO

func IsSVG

func IsSVG(r io.Reader) (bool, error)

func RegisterFormat

func RegisterFormat(magic string, decodeMeta DecodeMetaFunc)

func SetMaxSvgCheckRead

func SetMaxSvgCheckRead(n int)

Types

type BmpFormatError

type BmpFormatError string

func (BmpFormatError) Error

func (e BmpFormatError) Error() string

type DecodeMetaFunc

type DecodeMetaFunc func(io.Reader) (Meta, error)

type IcoMeta

type IcoMeta struct {
	Meta
	// contains filtered or unexported fields
}

func DecodeIcoMeta

func DecodeIcoMeta(r io.Reader) (*IcoMeta, error)

func (*IcoMeta) BestImageOffset

func (m *IcoMeta) BestImageOffset() int

func (*IcoMeta) BestImageSize

func (m *IcoMeta) BestImageSize() int

type JpegFormatError

type JpegFormatError string

func (JpegFormatError) Error

func (e JpegFormatError) Error() string

type Meta

type Meta interface {
	Format() string
	Width() int
	Height() int
}

func DecodeBmpMeta

func DecodeBmpMeta(r io.Reader) (Meta, error)

func DecodeGifMeta

func DecodeGifMeta(r io.Reader) (Meta, error)

func DecodeHeifMeta added in v2.16.0

func DecodeHeifMeta(r io.Reader) (Meta, error)

func DecodeJpegMeta

func DecodeJpegMeta(rr io.Reader) (Meta, error)

func DecodeMeta

func DecodeMeta(r io.Reader) (Meta, error)

func DecodePngMeta

func DecodePngMeta(r io.Reader) (Meta, error)

func DecodeTiffMeta

func DecodeTiffMeta(rr io.Reader) (Meta, error)

func DecodeWebpMeta

func DecodeWebpMeta(r io.Reader) (Meta, error)

type PngFormatError

type PngFormatError string

func (PngFormatError) Error

func (e PngFormatError) Error() string

type TiffFormatError

type TiffFormatError string

func (TiffFormatError) Error

func (e TiffFormatError) Error() string

Jump to

Keyboard shortcuts

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