Documentation ¶
Index ¶
- func BytesToThumb(img []byte, thumbPath string) error
- func CheckFFmpeg() (ok bool)
- func FrameNail(in, out string, n int) error
- func Nail(img []byte, size, quality int) (*bytes.Buffer, error)
- func NailWrite(imgPath, thumbPath string) error
- func OneFrame(in, out string, n int) error
- func ReadImage(img []byte) (image.Image, error)
- func ResizeLimit(img []byte, limit float64, quality int) (*bytes.Buffer, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToThumb ¶
BytesToThumb creates a thumbnail from img, uses default size and default quality, and write the thumbnail to thumbPath.
func Nail ¶
Nail creates a thumbnail of the img. Use default size(128) if size is set to zero. Use default quality(85) if quality is set to zero.
func NailWrite ¶
NailWrite reads an image from imgPath, creates a thumbnail of it, and write the thumbnail to thumbPath.
func OneFrame ¶
OneFrame 截取视频文件 in 的其中一帧 (第 n 秒),保存到文件 out 中。 建议 out 文件名的后缀为 ".jpg"。 例: OneFrame(video.mp4, screenshot.jpg, 10)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.