Download the PHP package bvtterfly/lio without Composer

On this page you can find all versions of the php package bvtterfly/lio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lio

🚨 THIS PACKAGE HAS BEEN ABANDONED 🚨

I no longer use Laravel and cannot justify the time needed to maintain this package. That's why I have chosen to abandon it. Feel free to fork my code and maintain your own copy.

Easily optimize images using Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Lio can optimize PNGs, JPGs, SVGs, and GIFs by running them through a chain of various image optimization tools.

This package is heavily based on Spatie's spatie/image-optimizer and spatie/laravel-image-optimizer packages and can optimize local images like them. In addition, It optimizes images stored on the Laravel filesystem disks.

Here's how you can use it:

If you don't like facades, just resolve a configured instance of Bvtterfly\Lio\OptimizerChain out of the container:

Installation

You can install the package via composer:

The package will automatically register itself.

The package uses a bunch of binaries to optimize images. To learn which ones on how to install them, head over to the image optimization tools section.

The package comes with some sane defaults to optimize images. You can modify that configuration by publishing the config file.

This is the contents of the published config file:

Command-Line Optimization tools

The package will use these optimizers if they are present on your system:

Here's how to install all the optimizers on Ubuntu:

And here's how to install the binaries on MacOS (using Homebrew):

And here's how to install the binaries on Fedora/RHEL/CentOS:

If You can't install and use above optimizers, You can still optimize your images using reSmush Optimizer.

Which tools will do what?

The package will automatically decide which tools to use on a particular image.

JPGs

JPGs will be made smaller by running them through JpegOptim. These options are used:

PNGs

PNGs will be made smaller by running them through two tools. The first one is Pngquant 2, a lossy PNG compressor. We set no extra options, their defaults are used. After that we run the image through a second one: Optipng. These options are used:

SVGs

SVGs will be minified by SVGO 2. SVGO's default configuration will be used, with the omission of the cleanupIDs plugin because that one is known to cause troubles when displaying multiple optimized SVGs on one page.

Please be aware that SVGO can break your svg. You'll find more info on that in this excellent blogpost by Sara Soueidan.

The default SVGO optimizer (Svgo2) is only compatible with SVGO 2.x. For custom SVGO configuration, you must create your configuration file and pass its path to the config array:

If you installed SVGO 1.x and can't upgrade to 2.x, You can uncomment the Svgo optimizer in the config file:

GIFs

GIFs will be optimized by Gifsicle. These options will be used:

WEBPs

WEBPs will be optimized by Cwebp. These options will be used:

(Settings are original taken from here)

Set Binary Path

If your binaries are not accessible in the global environment, You can set them using binaries_path option in the config file.

reSmush Optimizer

When you can't install command-line optimizer tools, you can comment them on the config file to disable them and uncomment the reSumsh optimizer to enable it. reSmush provides a free API for optimizing images. However, it can only optimize up to 5MB of PNG, JPG, GIF, BMP, and TIF images.

Usage

You can resolve a configured instance of Bvtterfly\Lio\OptimizerChain out of the container:

or using facade:

if your files are local you can using optimizeLocal method:

Using the middleware

If you want to optimize all uploaded images in requests to route automatically, You can use the OptimizeUploadedImages middleware.

Writing a custom optimizers

You may want to write your own optimizer to optimize your images via other utilities. An optimizer is any class that implements the Bvtterfly\Lio\Contracts\Optimizer interface:

If you want to view an example implementation take a look at the existing optimizers shipped with this package. You can add the fully qualified classname of your optimizer as a key in the optimizers array in the config file.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of lio with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-fileinfo Version *
guzzlehttp/guzzle Version ^7.4
illuminate/contracts Version ^9.0
spatie/laravel-package-tools Version ^1.9.2
spatie/temporary-directory Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bvtterfly/lio contains the following files

Loading the files please wait ....