plutuss/gif-creator-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

plutuss/gif-creator-laravel

最新稳定版本:1.0.0

Composer 安装命令:

composer require plutuss/gif-creator-laravel

包简介

Laravel GIF animation package - a wrapper for sybio/gif-creator. Easily create, manipulate, and store animated GIFs using Laravel storage and facades.

README 文档

README

A Laravel wrapper for sybio/gif-creator, providing a convenient way to create GIF animations using the GifCreator facade and storage. This package does not restrict the standard approach from sybio/gif-creator.

Installation

Install the package via Composer:

composer require plutuss/gif-creator-laravel

After installation, if you are using Laravel < 5.5, add the service provider and facade to config/app.php:

'providers' => [
    \Plutuss\Gif\Providers\GifCreatorServiceProvider::class,
],

'aliases' => [
    'GifCreator' =>  \Plutuss\Gif\Facades\GifCreator::class,
],

Usage

Creating a GIF

use Plutuss\Gif\Facades\GifCreator;

$gif = GifCreator::storage('public') // You can specify a disk name
    ->durations([40, 80, 40, 20, 10])
    ->frames(['1.jpg', '2.jpg', '3.jpg'], 'images/') // Pass an array of file names and a path if different
    ->loop()
    ->makeGif();

// Retrieve binary GIF data
$gifData = $gif->getGif();

// Display GIF in the browser
$gif->show();

// Save GIF to the server with a specified path and filename
$gif->save('gif/', 'animated.gif');

            // or

// Save GIF to storage
Storage::disk('public')->put('animated.gif', $gifData);

Methods

  • storage(string $disk = null) – Uses files from storage, allowing a specific disk name
  • durations(array $durations) – Sets frame durations
  • frames(array $files, string $path = '') – Loads frames from the specified path (pass an array of file names and a path if different)
  • loop(int $count = 0) – Sets the loop count (default is infinite)
  • makeGif() – Creates a GIF animation
  • getGif() – Retrieves binary GIF data
  • show() – Displays GIF in the browser
  • save(string $path, string $filename) – Saves the GIF to the server at the specified path

License

This package is licensed under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-11