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 fromstorage, allowing a specific disk namedurations(array $durations)– Sets frame durationsframes(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 animationgetGif()– Retrieves binary GIF datashow()– Displays GIF in the browsersave(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
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-11