Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dearmadman/laravel-image-tool
Simple ImageTool for laravel5
https://github.com/dearmadman/laravel-image-tool
Last synced: about 1 month ago
JSON representation
Simple ImageTool for laravel5
- Host: GitHub
- URL: https://github.com/dearmadman/laravel-image-tool
- Owner: DearMadMan
- License: mit
- Created: 2015-06-26T02:31:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-26T08:03:51.000Z (over 9 years ago)
- Last Synced: 2024-12-18T20:10:40.142Z (about 1 month ago)
- Language: PHP
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel ImageTool
Simple ImageTool for laravel 5## Installation
The ImageTool Service Provider can be installed via [Composer](http://getcomposer.org) by requiring the
`dearmadman/laravel-image-tool` package and setting the `minimum-stability` to `dev` (required for Laravel 5) in your
project's `composer.json`.```json
{
"require": {
"laravel/framework": "5.0.*",
"dearmadman/laravel-image-tool": "dev-master"
},
"minimum-stability": "dev"
}
```## Usage
To use the ImageTool Service Provider, you must register the provider when bootstrapping your Laravel application. There are
essentially two ways to do this.Find the `providers` key in `app/config/app.php` and register the ImageTool Service Provider.
```php
'providers' => array(
// ...
'Dearmadman\ImageTool\ImageToolServiceProvider',
)
```## Example Usage
```php
// [your site path]/app/routes.php
Route::Post('image-tool',function(){
$target=false;
if (config('image.compress_config_enable')) {
/* compress image */
$image_tool = ImageTool::GetInstance();
$arr=[
'jpeg_quality'=>config('image.compress_rate'),
'cover_img'=>config('image.compress_cover'),
];
$image_tool->SetConfig($arr);
$target = $image_tool->GetImageFromString($target,'img');
}return $target ? $target : "false" ;
});
```
^_^