photos

package
v0.0.0-...-1659c99 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchExts

func MatchExts(dir string, exts []string) ([]string, error)

func PhotoId

func PhotoId(r io.Reader) string

func ResizeAndCompress

func ResizeAndCompress(r io.Reader, w io.Writer, longSideSize int, quality int) (int, int, error)

func ResizeAndCompressStd

func ResizeAndCompressStd(r io.Reader, w io.Writer, longSideSize int, quality int) (int, int, error)

func ToJPEG

func ToJPEG(r io.Reader, w io.Writer, quality int) error

Types

type Exif

type Exif struct {
	DateTime        time.Time
	MakeModel       string
	ShutterSpeed    string
	FNumber         string
	ISO             string
	LensMakeModel   string
	FocalLength     string
	SubjectDistance string
}

type Photo

type Photo struct {
	ID string

	Title       string
	Description string
	Tags        []string

	URL  string
	Path string

	Format string
	Hash   []byte

	Exif *Exif

	PlaceholderURI template.URL
	Width          int
	Height         int

	ThumbURL    string
	ThumbPath   string
	ThumbWidth  int
	ThumbHeight int
	// contains filtered or unexported fields
}

func NewPhoto

func NewPhoto(r io.Reader, store storage.Storage, thumbSize int) (*Photo, error)

type Photos

type Photos struct {
	DB *sql.DB
}

func (Photos) Delete

func (ps Photos) Delete(id string) error

func (Photos) Get

func (ps Photos) Get(id string) (*Photo, error)

func (Photos) IDs

func (ps Photos) IDs() []string

func (*Photos) Init

func (ps *Photos) Init() error

func (Photos) Len

func (ps Photos) Len() int

func (*Photos) LoadFiles

func (ps *Photos) LoadFiles(in []string, store storage.Storage, conf *config.Config) error

func (Photos) Set

func (ps Photos) Set(p *Photo)

Jump to

Keyboard shortcuts

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