images

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ThumbnailWidth = 200

Variables

This section is empty.

Functions

func Crop

func Crop(w io.Writer, filename string, rect *Rect, options ...imaging.EncodeOption) error

Crop 图片裁切

func CropFromReader

func CropFromReader(w io.Writer, r io.Reader, format imaging.Format, rect *Rect, options ...imaging.EncodeOption) error

CropFromReader 图片裁切

func Label

func Label(w io.Writer, filename string, rects []*Rect, options ...imaging.EncodeOption) error

Label 图片标注

func LabelFromReader

func LabelFromReader(w io.Writer, r io.Reader, format imaging.Format, rects []*Rect, options ...imaging.EncodeOption) error

LabelFromReader 图片标注

func Thumbnail

func Thumbnail(w io.Writer, filename string, rect *Rect, options ...imaging.EncodeOption) error

Thumbnail 图片缩略图

func ThumbnailFromReader

func ThumbnailFromReader(w io.Writer, r io.Reader, format imaging.Format, rect *Rect, options ...imaging.EncodeOption) error

ThumbnailFromReader 图片缩略图

Types

type EXIF

type EXIF struct {
	Size        int64
	Format      string
	Width       int
	Height      int
	Orientation string
	Longitude   decimal.Decimal
	Latitude    decimal.Decimal
}

EXIF 定义图片EXIF

func ParseEXIF

func ParseEXIF(filename string) (*EXIF, error)

ParseEXIF 解析图片EXIF

type Orientation

type Orientation int

Orientation 图片的旋转方向

const (
	TopLeft     Orientation = 1
	TopRight    Orientation = 2
	BottomRight Orientation = 3
	BottomLeft  Orientation = 4
	LeftTop     Orientation = 5
	RightTop    Orientation = 6
	RightBottom Orientation = 7
	LeftBottom  Orientation = 8
)

func (Orientation) String

func (o Orientation) String() string

type Rect

type Rect struct {
	X int
	Y int
	W int
	H int
}

Rect 定义一个矩形框

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳