utilgo.mau.fi/util/lottie Index | Files

package lottie

import "go.mau.fi/util/lottie"

Index

Functions

func Convert

func Convert(ctx context.Context, input io.Reader, outputFilename string, outputWriter io.Writer, format string, width, height int, extraArgs ...string) error

Convert converts lottie data an image or image(s) using lottieconverter.

Args:

The outputFilename and outputWriter parameters are mutually exclusive.

func FFmpegConvert

func FFmpegConvert(ctx context.Context, input io.Reader, outputFile string, width, height, fps int) (thumbnailData []byte, err error)

FFmpegConvert converts lottie data to a video or image using ffmpeg.

This function should only be called if ffmpeg.Supported returns true.

Args:

Returns: the converted data as a *bytes.Buffer, the mimetype of the output, and the thumbnail data as a PNG.

func SetPath

func SetPath(path string)

SetPath overrides the path to the lottieconverter binary.

func Supported

func Supported() bool

Supported returns whether lottieconverter is available on the system.

lottieconverter is considered to be available if a binary called lottieconverter is found in $PATH, or if SetPath has been called explicitly with a non-empty path.

Source Files

convert.go

Version
v0.8.6 (latest)
Published
Mar 16, 2025
Platform
linux/amd64
Imports
10 packages
Last checked
1 week ago

Tools for package owners.