image

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindSpans

func FindSpans(r io.Reader, spans ...*Span) error

func LargerThumbFromContext added in v0.0.12

func LargerThumbFromContext(ctx context.Context) *photo.Thumb

func LargerThumbToContext

func LargerThumbToContext(ctx context.Context, th photo.Thumb) context.Context

func Remove

func Remove(data []byte) ([]byte, error)

func ToJpeg added in v0.0.12

func ToJpeg(imageBytes []byte) ([]byte, error)

ToJpeg converts a PNG/GIF/WEBP image to JPEG format.

Types

type Data added in v0.0.12

type Data struct {
	Image  photo.Image   `json:"image"`
	Exif   *photo.Exif   `json:"exif,omitempty"`
	Gps    *photo.Gps    `json:"gps,omitempty"`
	Meta   *photo.Meta   `json:"meta,omitempty"`
	Thumbs []photo.Thumb `json:"thumbs,omitempty"`
}

func (*Data) Fill added in v0.0.12

func (d *Data) Fill(ctx context.Context) error

func (*Data) FillFaces added in v0.0.12

func (d *Data) FillFaces(ctx context.Context, rec *faces.Recognizer) error

type Indexer

type Indexer struct {
	// contains filtered or unexported fields
}

func NewIndexer

func NewIndexer(deps indexerDeps) *Indexer

func (*Indexer) Index

func (i *Indexer) Index(ctx context.Context, img photo.Image, flags photo.IndexingFlags) (err error)

func (*Indexer) PhotoImageIndexer

func (i *Indexer) PhotoImageIndexer() photo.ImageIndexer

func (*Indexer) QueueCallback

func (i *Indexer) QueueCallback(ctx context.Context, cb func(ctx context.Context))

func (*Indexer) QueueIndex

func (i *Indexer) QueueIndex(ctx context.Context, img photo.Image, flags photo.IndexingFlags)

type Meta

type Meta struct {
	photo.Exif
	GpsInfo *photo.Gps `json:"gps_info,omitempty"`
	Rotate  int        `json:"orientation,omitempty" example:"90"`
	// contains filtered or unexported fields
}

func ReadMeta

func ReadMeta(r io.ReadSeeker) (Meta, error)

func (Meta) ExifData

func (m Meta) ExifData() map[string]any

type Resizer

type Resizer struct {
	Quality int
	Interp  resize.InterpolationFunction
}

type SimilarityIndex

type SimilarityIndex struct{}

func (*SimilarityIndex) Foo

func (si *SimilarityIndex) Foo()

type Span

type Span struct {
	Before        int
	Start, End    []byte
	CaseSensitive bool
	Result        []byte
	Found         bool
	Trim          bool
}

type Thumbnailer

type Thumbnailer struct {
	// contains filtered or unexported fields
}

func NewThumbnailer

func NewThumbnailer(deps ThumbnailerDeps) *Thumbnailer

func (*Thumbnailer) PhotoThumbnailer

func (t *Thumbnailer) PhotoThumbnailer() photo.Thumbnailer

func (*Thumbnailer) Thumbnail

func (t *Thumbnailer) Thumbnail(ctx context.Context, i photo.Image, size photo.ThumbSize) (th photo.Thumb, err error)

type ThumbnailerDeps

type ThumbnailerDeps interface {
	CtxdLogger() ctxd.Logger
}

Directories

Path Synopsis
Package faces contains autogenerated REST client.
Package faces contains autogenerated REST client.

Jump to

Keyboard shortcuts

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