Documentation
¶
Index ¶
- func AddImageThumb(media Media, size int, c Conf, wg *sync.WaitGroup, errChan chan<- error)
- func CreateOriginalFilePath(path string, c Conf) string
- func CreateSaveImageThumb(path string, media Media, size int, c Conf) ([]byte, error)
- func CreateSaveVideoThumb(path string, media Media, size int, c Conf) ([]byte, error)
- func CreateTempDir() (string, error)
- func CreateThumbFilePath(hash uint32, size int, c Conf) string
- func CreateThumbFromDisk(hash uint32, size int, c Conf) ([]byte, error)
- func CreateVideoThumb(path string) (io.Reader, error)
- func DecodeImage(path string) (image.Image, error)
- func GenerateSingleThumb(path string, media Media, size int, c Conf) ([]byte, error)
- func GetFFMPEGThumb(video string, frameNum int) (io.Reader, error)
- func GetThumbFromResizeService(media Media, size int, c Conf) ([]byte, error)
- func HandleResize(regenThumb bool, media Media, c Conf) (int, error)
- func HandleThumb(hash uint32, size int, c Conf) ([]byte, error)
- func ResizeImageUpload(w http.ResponseWriter, r *http.Request, c Conf) error
- func SafeImageOperation(operation func() ([]byte, error)) (file []byte, err error)
- func SaveImageToDisk(path string, image image.Image, c Conf) error
- type Conf
- type Media
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddImageThumb ¶
AddImageThumb creates a request to generate a single thumbnail from the original image.
func CreateOriginalFilePath ¶
CreateOriginalFilePath creates a string of the absolute path of the original media.
func CreateSaveImageThumb ¶
CreateSaveImageThumb opens the original file for image media types.
func CreateSaveVideoThumb ¶
CreateSaveVideoThumb saves and returns a thumbnail for video media types.
func CreateTempDir ¶
CreateTempDir creates a temporary directory and returns its path
func CreateThumbFilePath ¶
createThumbFilePath creates a string of the path where the thumb will live.
func CreateThumbFromDisk ¶
CreateThumbFromDisk checks for an existing thumbnail in the cache directory. If it does not exist, a new thumbnail is created and saved.
func CreateVideoThumb ¶
CreateVideoThumb creates a thumbnail for video media types.
func GenerateSingleThumb ¶
GenerateSingleThumb serves a generated thumbnail from the original media.
func GetFFMPEGThumb ¶
GetFFMPEGThumb serves a frame from a video.
func GetThumbFromResizeService ¶
GetThumbFromResizeService requests a thumbnail from the resize service, serves the response, and then saves it to disk.
func HandleResize ¶
HandleResize coordinates the parallel (go routine) generation of all non-existing thumbnails.
func HandleThumb ¶
HandleThumb determines whether to request a thumb from the resize service or check for one on disk.
func ResizeImageUpload ¶
ResizeImageUpload accepts an image via POST, resizes it based on the size query param, and serves the resulting image.
func SafeImageOperation ¶
SafeImageOperation executes an image operation function and recovers from panics