khelaia/pixover

image optimization while uploading

v1.0.2 2020-03-14 13:10 UTC

This package is auto-updated.

Last update: 2024-05-15 00:02:24 UTC


README

Latest Version on Packagist Total Downloads Build Status

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.