Versions in this module Expand all Collapse all v1 v1.4.0 Feb 5, 2023 v1.3.9 Feb 5, 2023 Changes in this version + const MajorVersion + const MicroVersion + const MinorVersion + const Version + var ImageMimeTypes = map[ImageType]string + var ImageTypes = map[ImageType]string + func IsAnimationSupported(imageType ImageType) bool + func IsLoadSupported(imageType ImageType) bool + func IsSaveSupported(imageType ImageType) bool + func ReadVipsMemStats(stats *MemoryStats) + func SetLogging(handler LoggingHandlerFunction, verbosity LogLevel) + func Shutdown() + func Startup(config *Config) + func WrapErr(err error) error + type Align int + const AlignCenter + const AlignHigh + const AlignLow + type Angle int + const Angle0 + const Angle180 + const Angle270 + const Angle90 + type Angle45 int + const Angle45_0 + const Angle45_135 + const Angle45_180 + const Angle45_225 + const Angle45_270 + const Angle45_315 + const Angle45_45 + const Angle45_90 + type AvifExportParams struct + Lossless bool + Quality int + Speed int + StripMetadata bool + func NewAvifExportParams() *AvifExportParams + type BlendMode int + const BlendModeAdd + const BlendModeAtop + const BlendModeClear + const BlendModeColorBurn + const BlendModeColorDodge + const BlendModeDarken + const BlendModeDest + const BlendModeDestAtop + const BlendModeDestIn + const BlendModeDestOut + const BlendModeDestOver + const BlendModeDifference + const BlendModeExclusion + const BlendModeHardLight + const BlendModeIn + const BlendModeLighten + const BlendModeMultiply + const BlendModeOut + const BlendModeOver + const BlendModeOverlay + const BlendModeSaturate + const BlendModeScreen + const BlendModeSoftLight + const BlendModeSource + const BlendModeXOR + type BoolParam struct + func (p *BoolParam) Get() bool + func (p *BoolParam) Set(v bool) + type Color struct + B uint8 + G uint8 + R uint8 + type ColorRGBA struct + A uint8 + B uint8 + G uint8 + R uint8 + type Config struct + CacheTrace bool + ConcurrencyLevel int + MaxCacheFiles int + MaxCacheMem int + MaxCacheSize int + ReportLeaks bool + VectorEnabled bool + type Direction int + const DirectionHorizontal + const DirectionVertical + type ExtendStrategy int + const ExtendBackground + const ExtendBlack + const ExtendCopy + const ExtendMirror + const ExtendRepeat + const ExtendWhite + type FilterFunc func(ctx context.Context, img *Image, load imagor.LoadFunc, args ...string) (err error) + type FilterMap map[string]FilterFunc + type GifExportParams struct + Bitdepth int + Dither float64 + Effort int + Quality int + StripMetadata bool + func NewGifExportParams() *GifExportParams + type HeifExportParams struct + Lossless bool + Quality int + func NewHeifExportParams() *HeifExportParams + type Image struct + func LoadImageFromBuffer(buf []byte, params *ImportParams) (*Image, error) + func LoadImageFromMemory(buf []byte, width, height, bands int) (*Image, error) + func LoadImageFromSource(s *Source, params *ImportParams) (*Image, error) + func LoadThumbnailFromSource(s *Source, width, height int, crop Interesting, size Size, ...) (*Image, error) + func (r *Image) AddAlpha() error + func (r *Image) Bands() int + func (r *Image) Close() + func (r *Image) ColorSpace() Interpretation + func (r *Image) Composite(overlay *Image, mode BlendMode, x, y int) error + func (r *Image) Copy() (*Image, error) + func (r *Image) Embed(left, top, width, height int, extend ExtendStrategy) error + func (r *Image) EmbedBackground(left, top, width, height int, backgroundColor *Color) error + func (r *Image) EmbedBackgroundRGBA(left, top, width, height int, backgroundColor *ColorRGBA) error + func (r *Image) Exif() map[string]any + func (r *Image) ExportAvif(params *AvifExportParams) ([]byte, error) + func (r *Image) ExportGIF(params *GifExportParams) ([]byte, error) + func (r *Image) ExportHeif(params *HeifExportParams) ([]byte, error) + func (r *Image) ExportJp2k(params *Jp2kExportParams) ([]byte, error) + func (r *Image) ExportJpeg(params *JpegExportParams) ([]byte, error) + func (r *Image) ExportPng(params *PngExportParams) ([]byte, error) + func (r *Image) ExportTiff(params *TiffExportParams) ([]byte, error) + func (r *Image) ExportWebp(params *WebpExportParams) ([]byte, error) + func (r *Image) ExtractArea(left, top, width, height int) error + func (r *Image) FindTrim(threshold float64, x, y int) (int, int, int, int, error) + func (r *Image) Flatten(backgroundColor *Color) error + func (r *Image) Flip(direction Direction) error + func (r *Image) Format() ImageType + func (r *Image) GaussianBlur(sigma float64) error + func (r *Image) GetPoint(x int, y int) ([]float64, error) + func (r *Image) HasAlpha() bool + func (r *Image) Height() int + func (r *Image) Interpretation() Interpretation + func (r *Image) Label(text, font string, x, y, size int, align Align, color *Color, opacity float64) error + func (r *Image) Linear(a, b []float64) error + func (r *Image) Modulate(brightness, saturation, hue float64) error + func (r *Image) Orientation() int + func (r *Image) PageHeight() int + func (r *Image) Pages() int + func (r *Image) RemoveExif() error + func (r *Image) RemoveICCProfile() error + func (r *Image) Replicate(across int, down int) error + func (r *Image) Rotate(angle Angle) error + func (r *Image) SetPageDelay(delay []int) error + func (r *Image) SetPageHeight(height int) error + func (r *Image) Sharpen(sigma float64, x1 float64, m2 float64) error + func (r *Image) Thumbnail(width, height int, crop Interesting) error + func (r *Image) ThumbnailWithSize(width, height int, crop Interesting, size Size) error + func (r *Image) ToColorSpace(interpretation Interpretation) error + func (r *Image) Width() int + type ImageType int + const ImageTypeAVIF + const ImageTypeBMP + const ImageTypeGIF + const ImageTypeHEIF + const ImageTypeJP2K + const ImageTypeJPEG + const ImageTypeMagick + const ImageTypePDF + const ImageTypePNG + const ImageTypeSVG + const ImageTypeTIFF + const ImageTypeUnknown + const ImageTypeWEBP + type ImportParams struct + AutoRotate BoolParam + Density IntParam + FailOnError BoolParam + HeifThumbnail BoolParam + JpegShrinkFactor IntParam + NumPages IntParam + Page IntParam + SvgUnlimited BoolParam + func NewImportParams() *ImportParams + func (i *ImportParams) OptionString() string + type IntParam struct + func (p *IntParam) Get() int + func (p *IntParam) Set(v int) + type Intent int + const IntentAbsolute + const IntentLast + const IntentPerceptual + const IntentRelative + const IntentSaturation + type Interesting int + const InterestingAll + const InterestingAttention + const InterestingCentre + const InterestingEntropy + const InterestingHigh + const InterestingLast + const InterestingLow + const InterestingNone + type Interpretation int + const InterpretationBW + const InterpretationCMC + const InterpretationCMYK + const InterpretationError + const InterpretationFourier + const InterpretationGrey16 + const InterpretationHSV + const InterpretationHistogram + const InterpretationLAB + const InterpretationLABQ + const InterpretationLABS + const InterpretationLCH + const InterpretationMatrix + const InterpretationMultiband + const InterpretationRGB + const InterpretationRGB16 + const InterpretationSRGB + const InterpretationScRGB + const InterpretationXYZ + const InterpretationYXY + type Jp2kExportParams struct + Lossless bool + Quality int + SubsampleMode SubsampleMode + TileHeight int + TileWidth int + func NewJp2kExportParams() *Jp2kExportParams + type JpegExportParams struct + Interlace bool + OptimizeCoding bool + OptimizeScans bool + OvershootDeringing bool + Quality int + QuantTable int + StripMetadata bool + SubsampleMode SubsampleMode + TrellisQuant bool + func NewJpegExportParams() *JpegExportParams + type LogLevel int + const LogLevelCritical + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelMessage + const LogLevelWarning + type LoggingHandlerFunction func(messageDomain string, messageLevel LogLevel, message string) + type MemoryStats struct + Allocs int64 + Files int64 + Mem int64 + MemHigh int64 + type Metadata struct + Bands int + ContentType string + Exif map[string]any + Format string + Height int + Orientation int + Pages int + Width int + type Option func(v *Processor) + func WithConcurrency(num int) Option + func WithDebug(debug bool) Option + func WithDisableBlur(disabled bool) Option + func WithDisableFilters(filters ...string) Option + func WithFilter(name string, filter FilterFunc) Option + func WithLogger(logger *zap.Logger) Option + func WithMaxAnimationFrames(num int) Option + func WithMaxCacheFiles(num int) Option + func WithMaxCacheMem(num int) Option + func WithMaxCacheSize(num int) Option + func WithMaxFilterOps(num int) Option + func WithMaxHeight(height int) Option + func WithMaxResolution(res int) Option + func WithMaxWidth(width int) Option + func WithMozJPEG(enabled bool) Option + type Param struct + func (p *Param) IsSet() bool + type PngExportParams struct + Bitdepth int + Compression int + Dither float64 + Filter PngFilter + Interlace bool + Palette bool + Profile string + Quality int + StripMetadata bool + func NewPngExportParams() *PngExportParams + type PngFilter int + const PngFilterAll + const PngFilterAvg + const PngFilterNone + const PngFilterPaeth + const PngFilterSub + const PngFilterUo + type Processor struct + Concurrency int + Debug bool + DisableBlur bool + DisableFilters []string + Filters FilterMap + Logger *zap.Logger + MaxAnimationFrames int + MaxCacheFiles int + MaxCacheMem int + MaxCacheSize int + MaxFilterOps int + MaxHeight int + MaxResolution int + MaxWidth int + MozJPEG bool + func NewProcessor(options ...Option) *Processor + func (v *Processor) CheckResolution(img *Image, err error) (*Image, error) + func (v *Processor) FocalThumbnail(img *Image, w, h int, fx, fy float64) (err error) + func (v *Processor) NewImage(ctx context.Context, blob *imagor.Blob, n int) (*Image, error) + func (v *Processor) NewThumbnail(ctx context.Context, blob *imagor.Blob, width, height int, crop Interesting, ...) (*Image, error) + func (v *Processor) Process(ctx context.Context, blob *imagor.Blob, p imagorpath.Params, ...) (*imagor.Blob, error) + func (v *Processor) Shutdown(_ context.Context) error + func (v *Processor) Startup(_ context.Context) error + func (v *Processor) Thumbnail(img *Image, width, height int, crop Interesting, size Size) error + type Size int + const SizeBoth + const SizeDown + const SizeForce + const SizeLast + const SizeUp + type Source struct + func NewSource(reader io.ReadCloser) *Source + func (s *Source) Close() + func (s *Source) LoadImage(params *ImportParams) (*Image, error) + func (s *Source) LoadThumbnail(width, height int, crop Interesting, size Size, params *ImportParams) (*Image, error) + type SubsampleMode int + const VipsForeignSubsampleAuto + const VipsForeignSubsampleLast + const VipsForeignSubsampleOff + const VipsForeignSubsampleOn + type TiffCompression int + const TiffCompressionDeflate + const TiffCompressionFax4 + const TiffCompressionJpeg + const TiffCompressionLzw + const TiffCompressionNone + const TiffCompressionPackbits + const TiffCompressionWebp + const TiffCompressionZstd + type TiffExportParams struct + Compression TiffCompression + Predictor TiffPredictor + Quality int + StripMetadata bool + func NewTiffExportParams() *TiffExportParams + type TiffPredictor int + const TiffPredictorFloat + const TiffPredictorHorizontal + const TiffPredictorNone + type WebpExportParams struct + IccProfile string + Lossless bool + NearLossless bool + Quality int + ReductionEffort int + StripMetadata bool + func NewWebpExportParams() *WebpExportParams