photoprism/internal/models/photo.go
Michael Mayer ffc64cceb0 Use 3x3 thumbnail for color indexing #7
Other implementations were unstable due to the use of random numbers.
This seems to be fast and also enables us to search specific parts
of an image. 16 colors are indexed (Material Design).
2019-04-26 02:22:53 +02:00

40 lines
1,010 B
Go

package models
import (
"time"
"github.com/jinzhu/gorm"
)
// A photo can have multiple images and sidecar files
type Photo struct {
gorm.Model
TakenAt time.Time
TakenAtChanged bool
PhotoTitle string
PhotoTitleChanged bool
PhotoDescription string `gorm:"type:text;"`
PhotoNotes string `gorm:"type:text;"`
PhotoArtist string
PhotoColors string
PhotoColor string
PhotoCanonicalName string
PhotoFavorite bool
PhotoLat float64
PhotoLong float64
PhotoFocalLength float64
PhotoAperture float64
Camera *Camera
CameraID uint
Lens *Lens
LensID uint
Country *Country
CountryID string
CountryChanged bool
Location *Location
LocationID uint
LocationChanged bool
Tags []*Tag `gorm:"many2many:photo_tags;"`
Files []*File
Albums []*Album `gorm:"many2many:album_photos;"`
}