Documentation ¶
Index ¶
- func Read(path string, params *vips.ImportParams) (*vips.ImageRef, error)
- func SetUp(config *vips.Config)
- func ToAvif(src, dest string, exportParams *vips.AvifExportParams) error
- func ToGif(src, dest string, exportParams *vips.GifExportParams) error
- func ToHeif(src, dest string, exportParams *vips.HeifExportParams) error
- func ToJpeg(src, dest string, exportParams *vips.JpegExportParams) error
- func ToPng(src, dest string, exportParams *vips.PngExportParams) error
- func ToTiff(src, dest string, exportParams *vips.TiffExportParams) error
- func ToWebp(src, dest string, exportParams *vips.WebpExportParams) error
- func ToWebpData(src string, exportParams *vips.WebpExportParams) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetUp ¶
SetUp
!!!: (1) macOS需要设置环境变量(否则govips may not compile): export CGO_CFLAGS_ALLOW="-Xpreprocessor" (2) 必要条件: CGO_ENABLED=1 (3) 涉及到C,交叉编译只能搞 当前所在环境 的.
PS: (1) vips 8.14.5支持的格式: webp、heif、pdf、png、tiff、svg、jp2k、gif、jpeg、magick.
@param config 可以为nil(使用默认配置: concurrency=1 cache_max_files=0 cache_max_mem=52428800 cache_max=100)
func ToHeif ¶
func ToHeif(src, dest string, exportParams *vips.HeifExportParams) error
ToHeif
PS: (0) 必需先set up; (1) iphone使用 heif格式 存储照片(占用内存比JPEG格式少); (2) 常见的HEIF封装类型文件有 .heic 和 .avif。
func ToWebpData ¶
func ToWebpData(src string, exportParams *vips.WebpExportParams) ([]byte, error)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.