Documentation ¶
Index ¶
- Constants
- Variables
- func Ext2Format(s string) string
- func Format2Ext(f string) string
- func GetPoint(sm, wm image.Point, pos Position) (pt image.Point)
- func SaveTo(w io.Writer, m image.Image, opt WriteOption) (n int, err error)
- func Thumbnail(r io.Reader, w io.Writer, topt ThumbOption) error
- func ThumbnailFile(src, dest string, topt ThumbOption) (err error)
- func ThumbnailImage(img image.Image, topt *ThumbOption) (image.Image, error)
- func Watermark(r, wr io.Reader, w io.Writer, wo WaterOption) error
- func WatermarkFile(src, dest string, wo WaterOption) (err error)
- func WatermarkImage(img, water image.Image, pos Position, opacity Opacity) (image.Image, error)
- type Attr
- type CountWriter
- type Dimension
- type Image
- type Opacity
- type Position
- type Quality
- type Size
- type ThumbOption
- type WaterOption
- type WriteOption
Constants ¶
View Source
const ( MinJPEGQuality = jpeg.DefaultQuality // 75 MinWebpQuality = 80 )
consts
Variables ¶
View Source
var ( ErrorFormat = errors.New("Invalid or unsupported Image Format") ErrOrigTooSmall = errors.New("Original Image Too Small") )
Functions ¶
func ThumbnailFile ¶
func ThumbnailFile(src, dest string, topt ThumbOption) (err error)
func ThumbnailImage ¶
ThumbnailImage ...
func WatermarkFile ¶
func WatermarkFile(src, dest string, wo WaterOption) (err error)
Types ¶
type Attr ¶
type Attr struct { Width Dimension `json:"width"` Height Dimension `json:"height"` Quality Quality `json:"quality,omitempty"` // Original quality Size Size `json:"size,omitempty"` // Original size Ext string `json:"ext"` // file extension include dot Mime string `json:"mime,omitempty"` // content type Name string `json:"name,omitempty"` // Deprecated }
Attr ...
type CountWriter ¶
type CountWriter struct {
// contains filtered or unexported fields
}
CountWriter ...
type ThumbOption ¶
type ThumbOption struct {
Width, Height uint
MaxWidth, MaxHeight uint
IsFit bool
IsCrop bool
CropX, CropY int
WriteOption
// contains filtered or unexported fields
}
ThumbOption ...
func (ThumbOption) String ¶
func (topt ThumbOption) String() string
type WaterOption ¶
type WaterOption struct { Pos Position Opacity Opacity Filename string WriteOption }
WaterOption ...
type WriteOption ¶
WriteOption ...
Click to show internal directories.
Click to hide internal directories.