Documentation ¶
Index ¶
- Constants
- func FillCenter(img image.Image, w, h int) *image.NRGBA
- func FillImageTransparency(img image.Image, c color.Color)
- func GenerateMiniPreviewImage(img image.Image, w, h, q int) ([]byte, error)
- func GeneratePreview(img image.Image, width int) image.Image
- func GenerateThumbnail(img image.Image, width, height int) image.Image
- func GetDimensions(imageData io.Reader) (int, int, error)
- func GetImageOrientation(input io.Reader) (int, error)
- func MakeImageUpright(img image.Image, orientation int) image.Image
- type Decoder
- type DecoderOptions
- type Encoder
- type EncoderOptions
- type SVGInfo
Constants ¶
const ( /* EXIF Image Orientations 1 2 3 4 5 6 7 8 888888 888888 88 88 8888888888 88 88 8888888888 88 88 88 88 88 88 88 88 88 88 88 88 8888 8888 8888 8888 88 8888888888 8888888888 88 88 88 88 88 88 88 888888 888888 */ Upright = iota + 1 UprightMirrored UpsideDown UpsideDownMirrored RotatedCWMirrored RotatedCCW RotatedCCWMirrored RotatedCW )
Variables ¶
This section is empty.
Functions ¶
func FillCenter ¶
FillCenter creates an image with the specified dimensions and fills it with the centered and scaled source image.
func FillImageTransparency ¶
FillImageTransparency fills in-place all the fully transparent pixels of the input image with the given color.
func GenerateMiniPreviewImage ¶
GenerateMiniPreviewImage generates the mini preview for the given image.
func GeneratePreview ¶
GeneratePreview generates the preview for the given image.
func GenerateThumbnail ¶
GenerateThumbnail generates the thumbnail for the given image.
func GetDimensions ¶
GetDimensions returns the dimensions for the given encoded image data.
func GetImageOrientation ¶
GetImageOrientation reads the input data and returns the EXIF encoded image orientation.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder holds the necessary state to decode images. This is safe to be used from multiple goroutines.
func NewDecoder ¶
func NewDecoder(opts DecoderOptions) (*Decoder, error)
NewDecoder creates and returns a new image decoder with the given options.
func (*Decoder) DecodeConfig ¶
DecodeConfig returns the image config for the given data.
func (*Decoder) DecodeMemBounded ¶
func (d *Decoder) DecodeMemBounded(rd io.Reader) (img image.Image, format string, releaseFunc func(), err error)
DecodeMemBounded works similarly to Decode but also returns a release function that must be called when access to the raw image is not needed anymore. This sets the raw image data pointer to nil in an attempt to help the GC to re-use the underlying data as soon as possible.
type DecoderOptions ¶
type DecoderOptions struct { // The level of concurrency for the decoder. This defines a limit on the // number of concurrently running encoding goroutines. ConcurrencyLevel int }
DecoderOptions holds configuration options for an image decoder.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Decoder holds the necessary state to encode images. This is safe to be used from multiple goroutines.
func NewEncoder ¶
func NewEncoder(opts EncoderOptions) (*Encoder, error)
NewEncoder creates and returns a new image encoder with the given options.
func (*Encoder) EncodeJPEG ¶
EncodeJPEG encodes the given image in JPEG format and writes the data to the passed writer.
type EncoderOptions ¶
type EncoderOptions struct { // The level of concurrency for the encoder. This defines a limit on the // number of concurrently running encoding goroutines. ConcurrencyLevel int }
EncoderOptions holds configuration options for an image encoder.