khelaia / pixover
image optimization while uploading
Requires
- ext-gd: *
- illuminate/support: ~5|~6|~7
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3|~4
- phpunit/phpunit: ^8.0
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2024-11-15 01:13:14 UTC
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.