Documentation ¶
Index ¶
Constants ¶
View Source
const (
// The WebP header to look for.
Header = "image/webp"
)
View Source
const Path = string(os.PathSeparator) + "webp"
Path defines the path where the executables reside.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Execer ¶
type Execer interface { Install() error Accepts(ctx *gin.Context) bool File(g *gin.Context, path string, mime domain.Mime) ([]byte, error) Convert(path string, compression int) }
Execer defines methods for WebP images to Convert and Obtain files from the file system.
type WebP ¶
type WebP struct {
// contains filtered or unexported fields
}
WebP
Defines the service for installing, converting, serving and determining if the browser can accept WebP images.
func (*WebP) Accepts ¶
Accepts
Determines if the browser can serve webp images by looking up the 'image/WebP' header.
func (*WebP) Convert ¶
Convert
Converts an image to WebP based on compression and decoded image. Compression level is also set.
Click to show internal directories.
Click to hide internal directories.