datauri

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidDataURI = errors.New("datauri: invalid DataURI")

ErrInvalidDataURI invalid DataURI string

View Source
var ErrUnsupportedEncoding = errors.New("datauri: unsupported encoding")

ErrUnsupportedEncoding encoding is unsupported

Functions

func DecodeDataURI

func DecodeDataURI(ctx context.Context, dataURI string) ([]byte, string, error)

DecodeDataURI decode DataURI into image bytes

Types

type AmrEncoding

type AmrEncoding struct {
}

func (*AmrEncoding) Decode

func (enc *AmrEncoding) Decode(dataURI []byte) (string, []byte)

Decode 转换dataURI格式到bytes

type BitmapEncoding

type BitmapEncoding struct {
}

BitmapEncoding bmp图片编码器

func (*BitmapEncoding) Decode

func (enc *BitmapEncoding) Decode(dataURI []byte) (string, []byte)

Decode 转换dataURI格式到bytes

type Encoding

type Encoding interface {
	Decode(dataURI []byte) (mediaType string, buf []byte)
}

Encoding 图片编码器

type GifEncoding

type GifEncoding struct {
}

GifEncoding gif图片编码器

func (*GifEncoding) Decode

func (enc *GifEncoding) Decode(dataURI []byte) (string, []byte)

Decode 转换dataURI格式到bytes

type JpegEncoding

type JpegEncoding struct {
}

JpegEncoding jpeg图片编码器

func (*JpegEncoding) Decode

func (enc *JpegEncoding) Decode(dataURI []byte) (string, []byte)

Decode 转换dataURI格式到bytes

type PngEncoding

type PngEncoding struct {
}

PngEncoding png图片编码器

func (*PngEncoding) Decode

func (enc *PngEncoding) Decode(dataURI []byte) (string, []byte)

Decode 转换dataURI格式到bytes

Jump to

Keyboard shortcuts

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