lottie

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MPL-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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:

  • input: an io.Reader containing the lottie data to convert.
  • outputFilename: the filename to write the output to.
  • outputWriter: an io.Writer to write the output to.
  • format: the output format. Can be one of: png, gif, or pngs.
  • width: the width of the output image(s).
  • height: the height of the output image(s).
  • extraArgs: additional arguments to pass to lottieconverter.

The outputFilename and outputWriter parameters are mutually exclusive.

func FFmpegConvert added in v0.8.1

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:

  • input: an io.Reader containing the lottie data to convert.
  • outputFile: the filename to write the output to. Must have .webp or .webm extension.
  • width: the width of the output video or image.
  • height: the height of the output video or image.
  • fps: the framerate of the output video.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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