Documentation
¶
Index ¶
- func CalculateMD5(path string) (string, error)
- func FileExists(path string) bool
- func GetFileDetails(path string) (*models.Image, error)
- func GetFileModTime(path string) (time.Time, error)
- func GetSourceImage(i *models.Image) (image.Image, error)
- func GetStudioName(reader models.StudioReader, image *models.Image) (string, error)
- func GetThumbnail(srcImage image.Image, maxSize int) ([]byte, error)
- func GetTitle(s *models.Image) string
- func IsCover(img *models.Image) bool
- func PathDisplayName(path string) string
- func Serve(w http.ResponseWriter, r *http.Request, path string)
- func SetFileDetails(i *models.Image) error
- func ThumbnailNeeded(srcImage image.Image, maxSize int) bool
- func ToBasicJSON(image *models.Image) *jsonschema.Image
- func UpdateFileModTime(qb models.ImageWriter, id int, modTime models.NullSQLiteTimestamp) (*models.Image, error)
- func ZipFilename(zipFilename, filenameInZip string) string
- type Importer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateMD5 ¶
func FileExists ¶
func GetFileDetails ¶
GetFileDetails returns a pointer to an Image object with the width, height and size populated.
func GetFileModTime ¶
GetFileModTime gets the file modification time, handling files in zip files.
func GetStudioName ¶
GetStudioName returns the name of the provided image's studio. It returns an empty string if there is no studio assigned to the image.
func GetThumbnail ¶
GetThumbnail returns the thumbnail image of the provided image resized to the provided max size. It resizes based on the largest X/Y direction. It returns nil and an error if an error occurs reading, decoding or encoding the image.
func PathDisplayName ¶
PathDisplayName converts an image path for display. It translates the zip file separator character into '/', since this character is also used for path separators within zip files. It returns the original provided path if it does not contain the zip file separator character.
func SetFileDetails ¶
func ToBasicJSON ¶
func ToBasicJSON(image *models.Image) *jsonschema.Image
ToBasicJSON converts a image object into its JSON object equivalent. It does not convert the relationships to other objects, with the exception of cover image.
func UpdateFileModTime ¶ added in v0.5.0
func UpdateFileModTime(qb models.ImageWriter, id int, modTime models.NullSQLiteTimestamp) (*models.Image, error)
func ZipFilename ¶
Types ¶
type Importer ¶
type Importer struct { ReaderWriter models.ImageReaderWriter StudioWriter models.StudioReaderWriter GalleryWriter models.GalleryReaderWriter PerformerWriter models.PerformerReaderWriter TagWriter models.TagReaderWriter Input jsonschema.Image Path string MissingRefBehaviour models.ImportMissingRefEnum ID int // contains filtered or unexported fields }