libvips_go

package module
v0.0.0-...-f47dde0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2022 License: MIT Imports: 13 Imported by: 0

README

LibVips-go library.

Required libvips 8.9+. Only part of the functionality is implemented.

Golang wrapper for libvips.

Documentation

Index

Constants

View Source
const Version = string(C.VIPS_VERSION)

Variables

View Source
var (
	ErrUnsupportedImageFormat = fmt.Errorf("unsupported image file format")
	ErrInvalidFileFormat      = fmt.Errorf("invalid file format")
)
View Source
var DefaultEncodeConfig = encodeConfig{
	// contains filtered or unexported fields
}

Functions

func CacheGetMaxFiles

func CacheGetMaxFiles() uint

func CacheGetMaxMem

func CacheGetMaxMem() uint64

func CacheGetSize

func CacheGetSize() uint

func Cleanup

func Cleanup()

func Shutdown

func Shutdown()

func TrackedGetAllocs

func TrackedGetAllocs() uint

func TrackedGetFiles

func TrackedGetFiles() uint

func TrackedGetMem

func TrackedGetMem() uint64

func TrackedGetMemHighwater

func TrackedGetMemHighwater() uint64

Types

type Gravity

type Gravity int
const (
	GravityTopLeft Gravity = iota
	GravityTop
	GravityTopRight
	GravityLeft
	GravityCenter
	GravityRight
	GravityBottomLeft
	GravityBottom
	GravityBottomRight
)

func (Gravity) MarshalText

func (gr Gravity) MarshalText() ([]byte, error)

func (Gravity) PointOnPicture

func (gr Gravity) PointOnPicture(w, h int) (image.Point, error)

func (Gravity) PointWatermark

func (gr Gravity) PointWatermark(w, h, wmW, wmH int) (image.Point, error)

func (Gravity) String

func (gr Gravity) String() string

func (*Gravity) UnmarshalText

func (gr *Gravity) UnmarshalText(val []byte) error

type HEIFCompressionType

type HEIFCompressionType int

type ImageFormat

type ImageFormat int

func FormatByMagicNumber

func FormatByMagicNumber(buf []byte) ImageFormat

func (ImageFormat) Ext

func (imgFmt ImageFormat) Ext() string

func (ImageFormat) MarshalText

func (imgFmt ImageFormat) MarshalText() ([]byte, error)

func (ImageFormat) String

func (imgFmt ImageFormat) String() string

func (*ImageFormat) UnmarshalText

func (imgFmt *ImageFormat) UnmarshalText(val []byte) error

type VipsImage

type VipsImage struct {
	// contains filtered or unexported fields
}

func Join

func Join(in []*VipsImage) (*VipsImage, error)

func Load

func Load(buf []byte) (*VipsImage, error)

func LoadFromFile

func LoadFromFile(file string) (*VipsImage, error)

func LoadFromImage

func LoadFromImage(data image.Image) *VipsImage

func LoadPDFPages

func LoadPDFPages(buf []byte, page, num int) (*VipsImage, error)

func Pixel

func Pixel() *VipsImage

func (*VipsImage) AddWatermark

func (img *VipsImage) AddWatermark(wm *VipsImage, pt image.Point, opacity float64) error

func (*VipsImage) Blur

func (img *VipsImage) Blur(sigma float32) error

func (*VipsImage) Clear

func (img *VipsImage) Clear()

func (*VipsImage) CopyMemory

func (img *VipsImage) CopyMemory() error

func (*VipsImage) Crop

func (img *VipsImage) Crop(dstW, dstH int, pt image.Point) error

func (*VipsImage) EnsureAlpha

func (img *VipsImage) EnsureAlpha() error

func (*VipsImage) Extract

func (img *VipsImage) Extract(out *VipsImage, pt image.Point, w, h int) error

func (*VipsImage) Fill

func (img *VipsImage) Fill(dstW, dstH int, pt image.Point) error

func (*VipsImage) Flip

func (img *VipsImage) Flip() error

func (*VipsImage) HasAlpha

func (img *VipsImage) HasAlpha() bool

func (*VipsImage) Height

func (img *VipsImage) Height() int

func (*VipsImage) IsAnimated

func (img *VipsImage) IsAnimated() bool

func (*VipsImage) Resize

func (img *VipsImage) Resize(scale float64, hasAlpha bool) error

func (*VipsImage) Rotate

func (img *VipsImage) Rotate(angle int) error

func (*VipsImage) Save

func (img *VipsImage) Save(imgType ImageFormat, opts encodeConfig) ([]byte, error)

func (*VipsImage) SaveAsIco

func (img *VipsImage) SaveAsIco() ([]byte, error)

func (*VipsImage) SetInt

func (img *VipsImage) SetInt(key string, val int)

func (*VipsImage) Sharpen

func (img *VipsImage) Sharpen(sigma float32) error

func (*VipsImage) SmartCrop

func (img *VipsImage) SmartCrop(w, h int) error

VipsJpeg: out of order read at line XXXX https://github.com/libvips/libvips/issues/639#issuecomment-294513915

func (*VipsImage) Strip

func (img *VipsImage) Strip() error

Strip - Remove EXIF data

func (*VipsImage) Trim

func (img *VipsImage) Trim(threshold float64, smart bool, color color.RGBA, equalHor bool, equalVer bool) error

func (*VipsImage) Width

func (img *VipsImage) Width() int

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL