Documentation ¶
Index ¶
- Constants
- Variables
- type ImageFile
- func (i *ImageFile) ContentType() string
- func (i *ImageFile) Filename() string
- func (i *ImageFile) FilenameExt() string
- func (i *ImageFile) Format() string
- func (i *ImageFile) ImageSize() (int, int)
- func (i *ImageFile) Path() string
- func (i *ImageFile) Save() error
- func (i *ImageFile) SaveWithFormat(format imaging.Format) error
- func (i *ImageFile) Scale(dstWidth int, dstHeight int, upscale bool, trans Transformation) *image.NRGBA
- func (i *ImageFile) ToBytes() ([]byte, error)
- func (i *ImageFile) ToBytesWithFormat(format imaging.Format) ([]byte, error)
- func (i *ImageFile) Transform(operation *Operation, qs map[string]string) (*ImageFile, error)
- func (i *ImageFile) URL() string
- type Operation
- type Transformation
Constants ¶
View Source
const DefaultFormat = imaging.PNG
Variables ¶
View Source
var ContentTypes = map[string]string{
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"png": "image/png",
"bmp": "image/bmp",
"gif": "image/gif",
}
View Source
var Extensions = map[string]string{
"image/jpeg": "jpg",
"image/png": "png",
"image/bmp": "bmp",
"image/gif": "gif",
}
View Source
var Formats = map[string]imaging.Format{ "image/jpeg": imaging.JPEG, "image/png": imaging.PNG, "image/gif": imaging.GIF, "image/bmp": imaging.BMP, }
View Source
var HeaderKeys = []string{
"Age",
"Content-Type",
"Last-Modified",
"Date",
"Etag",
}
View Source
var Operations = map[string]*Operation{ Resize.Name: Resize, Thumbnail.Name: Thumbnail, }
View Source
var Resize = &Operation{ "resize", imaging.Resize, }
View Source
var Thumbnail = &Operation{ "thumbnail", imaging.Thumbnail, }
Functions ¶
This section is empty.
Types ¶
type ImageFile ¶
type ImageFile struct { Source []byte Image image.Image Key string Headers map[string]string Filepath string Storage gostorages.Storage }
func FromStorage ¶
func FromStorage(storage gostorages.Storage, filepath string) (*ImageFile, error)
func (*ImageFile) ContentType ¶
func (*ImageFile) FilenameExt ¶
func (*ImageFile) ToBytesWithFormat ¶
type Operation ¶
type Operation struct { Name string Transformation Transformation }
type Transformation ¶
Click to show internal directories.
Click to hide internal directories.