tools

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ISImageMagickInstalled bool

Functions

func CheckMagick

func CheckMagick() error

CheckMagick 检查是否已安装对应版本的 ImageMagick

func ConvertImageToImage

func ConvertImageToImage(inputPath string, outputFormat string) ([]byte, error)

ConvertImageToImage 将任意 ImageMagick 支持的文件格式转换为任意 ImageMagick 支持的格式 依赖外部库 ImageMagick,且有 Path 环境变量可以直接调用 magick 命令 ConvertImageToImage 大文件友好的图像格式转换,支持流式处理

func ConvertImageToImageAndWrite

func ConvertImageToImageAndWrite(inputPath string, outputPath string) error

ConvertImageToImageAndWrite 将任意 ImageMagick 支持的文件格式转换为任意 ImageMagick 支持的格式,并写出 依赖外部库 ImageMagick,且有 Path 环境变量可以直接调用 magick 命令

func ConvertImageToPng

func ConvertImageToPng(filepath string) (imageData []byte, err error)

ConvertImageToPng 将 ImageMagick 支持的文件格式转换为 PNG 格式 依赖外部库 ImageMagick,且有 Path 环境变量可以直接调用 magick 命令

func IsSupportedImageType

func IsSupportedImageType(filepath string) error

IsSupportedImageType 是否是 ImageMagick 支持的图片格式 依赖外部库 ImageMagick,且有 Path 环境变量可以直接调用 magick 命令

func SetHideWindow

func SetHideWindow(cmd *exec.Cmd)

SetHideWindow 隐藏窗口 这个函数通常在执行外部命令时使用,以确保命令行窗口不会显示出来。 但在非 Windows 系统下,这个函数什么也不做。

Types

This section is empty.

Jump to

Keyboard shortcuts

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