Documentation ¶
Index ¶
- Constants
- Variables
- func AlbumHash(name string) uniq.Hash
- type Album
- type AlbumImageAdder
- type AlbumImageDeleter
- type AlbumImageFinder
- type AlbumSettings
- type ChronoText
- type Exif
- type Face
- type Gps
- type Gpx
- type GpxSettings
- type Image
- type ImageIndexer
- type ImageLabeldeprecated
- type ImageSettings
- type IndexingFlags
- type Label
- type MapTile
- type Meta
- type MetaData
- type PercentBox
- type Thumb
- type ThumbSize
- type Thumbnailer
Constants ¶
View Source
const ( Orphan = "orphan-photos" Broken = "broken-photos" )
Names of special "albums".
Variables ¶
View Source
var ThumbSizes = []ThumbSize{"2400w", "1200w", "600w", "300w", "200h", "400h"}
Functions ¶
Types ¶
type Album ¶
type Album struct { uniq.Head Title string `db:"title" json:"title" formType:"textarea" title:"Title" description:"Title of an album."` Name string `db:"name" json:"name" title:"Name" required:"true" readOnly:"true" description:"A slug value that is used in album URL."` Public bool `` /* 138-byte string literal not displayed */ Hidden bool `` /* 145-byte string literal not displayed */ CoverImage uniq.Hash `db:"cover_image" json:"cover_image,omitempty" title:"Cover Image" description:"Hash of image to use as a cover."` Settings AlbumSettings `db:"settings" json:"settings" title:"Settings" description:"Additional parameters for an album."` // contains filtered or unexported fields }
type AlbumImageAdder ¶
type AlbumImageDeleter ¶
type AlbumImageFinder ¶
type AlbumImageFinder interface { FindImages(ctx context.Context, albumHash uniq.Hash) ([]Image, error) FindPreviewImages(ctx context.Context, albumHash uniq.Hash, coverImage uniq.Hash, limit uint64) ([]Image, error) FindOrphanImages(ctx context.Context) ([]Image, error) SearchImages(ctx context.Context, query string) ([]Image, error) FindBrokenImages(ctx context.Context) ([]Image, error) FindImageAlbums(ctx context.Context, excludeAlbum uniq.Hash, imageHashes ...uniq.Hash) (map[uniq.Hash][]Album, error) }
type AlbumSettings ¶
type AlbumSettings struct { Description string `json:"description,omitempty" formType:"textarea" title:"Description" description:"Description of an album, can contain HTML."` GpxTracksHashes []uniq.Hash `json:"gpx_tracks_hashes,omitempty" title:"GPX track hashes"` NewestFirst bool `json:"newest_first,omitempty" noTitle:"true" inlineTitle:"Newest first" description:"Show newest images at the top."` DailyRulers bool `json:"daily_rulers,omitempty" noTitle:"true" inlineTitle:"Daily rulers" description:"Show date splits between the photos."` Texts []ChronoText `json:"texts,omitempty" title:"Chronological texts"` // Deprecated: TODO remove and implement as separate entity. Redirect string `json:"redirect,omitempty" title:"Relative or absolute URL to redirect to with HTTP 301 status."` // Deprecated: TODO remove and implement on images. ImageBaseURL string `json:"image_base_url,omitempty" title:"URL prefix to use for full-res images instead of local endpoint."` HideMap bool `json:"hide_map,omitempty" noTitle:"true" inlineTitle:"Hide map on album page."` MapTiles string `` /* 201-byte string literal not displayed */ MapAttribution string `json:"attribution" title:"Map attribution" description:"Map tiles attribution, overrides app default."` CollabKey string `json:"collab_key" title:"Collaboration key, when provided, user can add/delete album content."` }
func (*AlbumSettings) Scan ¶
func (s *AlbumSettings) Scan(src any) error
type ChronoText ¶
type Exif ¶
type Exif struct { uniq.Head Rating int `db:"rating" json:"rating" title:"Rating" minimum:"0" maximum:"5"` ExposureTime string `db:"exposure_time" json:"exposure_time" title:"Exposure"` ExposureTimeSec float64 `db:"exposure_time_sec" json:"exposure_time_sec" title:"Exposure (sec.)"` FNumber float64 `db:"f_number" json:"f_number" title:"Aperture"` FocalLength float64 `db:"focal_length" json:"focal_length" title:"Focal length"` ISOSpeed int `db:"iso_speed" json:"iso_speed" title:"ISO"` LensModel string `db:"lens_model" json:"lens_model" title:"Lens"` CameraMake string `db:"camera_make" json:"camera_make" title:"Manufacturer"` CameraModel string `db:"camera_model" json:"camera_model" title:"Camera"` Software string `db:"software" json:"software" title:"Software"` Digitized *time.Time `db:"digitized" json:"digitized" title:"Digitized"` ProjectionType string `db:"projection_type" json:"projection_type" title:"Projection" description:"Use 'equirectangular' for 360 panorama."` }
type Face ¶ added in v0.0.12
type Face struct { Box *PercentBox `json:"box"` Descriptor []float64 `json:"descriptor"` Marks []PercentBox `json:"marks"` }
type GpxSettings ¶
type GpxSettings struct { Name string `json:"name,omitempty"` MinLat float64 `json:"minLat"` MinLon float64 `json:"minLon"` MaxLat float64 `json:"maxLat"` MaxLon float64 `json:"maxLon"` }
func (*GpxSettings) Scan ¶
func (s *GpxSettings) Scan(src any) error
type Image ¶
type Image struct { uniq.File Width int64 `db:"width" title:"Width, px" json:"width" readOnly:"true"` Height int64 `db:"height" title:"Height, px" json:"height" readOnly:"true"` BlurHash string `db:"blurhash" title:"BlurHash" json:"blurhash" readOnly:"true"` PHash uniq.Hash `db:"phash" title:"PerceptionHash" json:"phash" readonly:"true"` // uniq.Hash is used JSON accuracy. TakenAt *time.Time `db:"taken_at" title:"Taken At" json:"taken_at"` Settings ImageSettings `db:"settings" json:"settings" title:"Settings" description:"Additional parameters for an album."` }
type ImageIndexer ¶
type ImageLabel
deprecated
added in
v0.0.12
type ImageSettings ¶
type ImageSettings struct { Description string `json:"description,omitempty" formType:"textarea" title:"Description" description:"Description of an image, can contain HTML."` HTTPSources []string `json:"http_sources,omitempty"` }
func (*ImageSettings) Scan ¶
func (s *ImageSettings) Scan(src any) error
TODO: generalize scanner with generics.
type IndexingFlags ¶
type Label ¶ added in v0.0.12
type Label struct { Text string `json:"text,omitempty"` Score float64 `json:"score,omitempty"` Box *PercentBox `json:"box,omitempty"` }
type MetaData ¶ added in v0.0.12
type MetaData struct { ImageClassification []ImageLabel `json:"image_classification,omitempty"` Faces []faces.GoFaceFace `json:"faces,omitempty"` GeoLabel *string `json:"geo_label,omitempty"` CFResnet50 []Label `json:"cf_resnet_50,omitempty"` CFLlavaDescription *string `json:"cf_llava_description,omitempty"` CFDetrResnet []Label `json:"cf_detr_resnet,omitempty"` FaceVectors []Face `json:"face_vectors,omitempty"` }
type PercentBox ¶ added in v0.0.12
type PercentBox struct { Top float32 `json:"t%" description:"Top position in percent of image height."` Left float32 `json:"l%" description:"Left position in percent of image width."` Height float32 `json:"h%,omitempty" description:"Height of the box in percent of image height."` Width float32 `json:"w%,omitempty" description:"Width of the box in percent of image width."` }
type Thumb ¶
type Thumb struct { uniq.Head Width uint `db:"width" json:"width"` Height uint `db:"height" json:"height"` Data []byte `db:"data" json:"data,omitempty"` FilePath string `db:"file_path" json:"file_path,omitempty"` Format ThumbSize `db:"-" json:"format,omitempty"` SpriteFile string `db:"-" json:"sprite_file,omitempty"` SpriteOffset int `db:"-" json:"sprite_offset,omitempty"` }
func (Thumb) ReadSeeker ¶
func (t Thumb) ReadSeeker() io.ReadSeeker
Click to show internal directories.
Click to hide internal directories.