imgtool

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TelegramMaxPhotoFileSize        int = 10 * 1024 * 1024
	TelegramMaxPhotoTotalSideLength int = 10000
	TelegramMaxPhotoSideLength      int = 2560
)

Variables

This section is empty.

Functions

func Compress

func Compress(inputPath, outputPath, format string, maxEdgeLength int) error

Compress compresses the image at inputPath and saves the result to outputPath.

The input image will be resized so that its longest edge does not exceed maxEdgeLength,

func CompressForTelegram

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

func CompressForTelegramFromFile

func CompressForTelegramFromFile(filePath string) (*osutil.TempFile, error)

func FFmpegAvailable

func FFmpegAvailable() bool

func GetImagePhash

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

func GetImagePhashFromReader

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

func GetImageThumbHash

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

func GetSize

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

func GetSizeFromReader

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

func UgoiraZipToMp4

func UgoiraZipToMp4(zipPath string, frames []shared.UgoiraFrame, outputPath string) (string, error)

UgoiraZipToMp4 从 ugoira 的 zip 解压并转换为 mp4

返回生成的 mp4 路径(可能与 outputPath 不同,会自动添加 .mp4 后缀)

Types

This section is empty.

Jump to

Keyboard shortcuts

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