photo

package
v0.0.0-...-f1991a8 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDesiredSubImageLargerThanMasterErr

func IsDesiredSubImageLargerThanMasterErr(err error) bool

func NewDesiredSubImageLargerThanMasterErr

func NewDesiredSubImageLargerThanMasterErr() error

Types

type Collection

type Collection interface {
	GetName() CollectionName
	//Description
	GetDescription() (string, error)
	SetDescription(string) error
	//Photos (or links to them via id)
	LinkPhoto(PhotoHash) error
	UnlinkPhoto(PhotoHash) error
	GetAllPhotoHashes() ([]PhotoHash, error)
}

type CollectionName

type CollectionName string

type Image

type Image interface {
	GetFormat() imageformat.Format
	GetSize() uint64
	GetResolution() resolution.Resolution
	GetPhoto() Photo
	GetData() (io.ReadCloser, error)
	SetData(io.Reader) error
}

type Photo

type Photo interface {
	GetHash() PhotoHash
	GetDescription() (string, error)
	SetDescription(string) error
	GetTimeTaken() (time.Time, error)
	SetTimeTaken(time.Time) error
	GetImages() ([]Image, error)
	GetImageByResolutionID(resolution.ResolutionID) (Image, error)

	//****** I am not sure I like this. Would rather have a "NewPhoto func that generated internally *********"
	//Can only be set once if trying to overwrite should fail
	SetOriginalImage(fmt imageformat.Format, size uint64, height, width uint64, data io.Reader) (Image, error)
	//Can only be set once if trying to overwrite should fail
	SetMasterImage(fmt imageformat.Format, size uint64, height, width uint64, data io.Reader) (Image, error)

	//Should check to see if we have an image of that resolution first
	//Commenting out as I think that we shouldn't have so setable fields
	// NewImage(fmt imageformat.Format, size uint64, height, width uint64, data io.Reader) (Image, error)
	CreateSubImage(resolution.Resolution) error
	RemoveImage(resolution.ResolutionID) error
}

type PhotoHash

type PhotoHash string

Jump to

Keyboard shortcuts

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