imgtool

package
v0.89.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressImageByFFmpeg

func CompressImageByFFmpeg(inputPath, outputPath string, maxEdgeLength int) error

使用 ffmpeg 压缩图片

func CompressImageForTelegramByFFmpegFromBytes

func CompressImageForTelegramByFFmpegFromBytes(input []byte) ([]byte, error)

func CompressImageToJPEG

func CompressImageToJPEG(input []byte, maxEdgeLength, maxFileSize uint) ([]byte, error)

func GetImagePhash

func GetImagePhash(img image.Image) (string, error)

func GetImagePhashFromReader

func GetImagePhashFromReader(r io.Reader) (string, error)

func GetImageSize

func GetImageSize(img image.Image) (int, int, error)

func GetImageSizeFromReader

func GetImageSizeFromReader(r io.Reader) (int, int, error)

func GetImageThumbHash

func GetImageThumbHash(img image.Image) (string, error)

func ResizeImage

func ResizeImage(img image.Image, width, height uint) image.Image

ResizeImage resizes an image to the specified width and height.

It use golang.org/x/image/draw and CatmullRom interpolation. (Slow but high quality, and cost many memory)

Types

This section is empty.

Jump to

Keyboard shortcuts

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