承接 aarsteinmedia/lottie-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aarsteinmedia/lottie-php

Composer 安装命令:

composer require aarsteinmedia/lottie-php

包简介

Create still SVGs from Lottie Animations on the backend, for previews.

README 文档

README

Render still SVG frames from Lottie animations on the server — useful for previews, thumbnails, and CMS integrations without a browser runtime.

Supports Lottie JSON (.json) and dotLottie (.lottie) files.

Requirements

  • PHP 8.1+
  • ext-zip (for .lottie archives)

Installation

composer require aarsteinmedia/lottie-php

Usage

Render a single frame to an SVG string:

use LottiePHP\LottieToSVG;

$svg = LottieToSVG::renderFrame('/path/to/animation.json');

By default, the middle frame is rendered. Pass a frame index to pick another:

$svg = LottieToSVG::renderFrame('/path/to/animation.json', frame: 0);

Optional renderer settings (size, aspect ratio, CSS class, etc.):

$svg = LottieToSVG::renderFrame('/path/to/animation.lottie', [
    'width' => 512,
    'height' => 512,
    'preserveAspectRatio' => 'xMidYMid meet',
], frame: 0);

Batch rendering

When rendering many frames from the same file, load once and reuse the animation instance:

$anim = LottieToSVG::loadCached('/path/to/animation.json');

foreach ([0, 15, 30] as $frame) {
    $svg = LottieToSVG::renderFrameFromAnimation($anim, $frame);
}

loadCached() skips re-parsing when the file path and modification time are unchanged. renderFrame() uses this automatically when no custom renderer settings are passed.

Development

Clone the repo, run composer install, then start the visual smoke-test UI:

composer visual:up

Open http://localhost:8000 to browse sample animations and inspect rendered SVG output.

Other scripts: composer lint, composer visual:down, composer visual:logs.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-05-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固