khelaia/pixover
Composer 安装命令:
composer require khelaia/pixover
包简介
image optimization while uploading
README 文档
README
The Pixover helps you make the web page more flexible and fast. You can upload photos with Pixover in as much resolution as you need. This will ultimately give you the optimum result for web page speed.
Installation
- Via Composer
$ composer require khelaia/pixover
- Add the service provider to your $providers array in config/app.php file like:
khelaia\pixover\pixoverServiceProvider::class
Usage
- Import the class namespaces first, before using it
use khelaia\pixover\pixover;
- Create Object
$image = new pixover($file, $filename, $upload_path);
Example
In this example, we are creating images in three different resolution x256 x512 and x128. As a result we have array of image names and 3 lightweight image
public function store(Request $request){ $file = $request->file('image'); $image = new pixover($file,'thumbnail',public_path('images')); $image->setHight([256,512,128]); $image->done(); return "success"; }
Uploaded file structure in /public directory
.
├── ...
├── images
│ ├── x128
│ │ └── thumbnail.jpg
│ ├── x256
│ │ └── thumbnail.jpg
│ └── x512
│ └── thumbnail.jpg
└── ...
Change log
Please see the changelog for more information on what has changed recently.
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
license. Please see the license file for more information.
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-06