pyaehein/laravellqip

LQIP Image handling for laravel.
22 1
Install
composer require pyaehein/laravellqip
Latest Version:v0.1.1
License:MIT
Last Updated:Jun 8, 2017
Links: GitHub  ·  Packagist
Maintainer: nnieheayp

PyaeHein / Laravel LQIP

Latest Version on Packagist Software License Total Downloads

Laravel LQIP package, which includes:

  • low quality image auto creating ;
  • replace src with lazysize

Install on Laravel 5.4

  1. Run in your terminal:
$ composer require pyaehein/laravellqip
  1. Add the service providers in config/app.php:
PyaeHein\LQIP\LQIPServiceProvider::class,
  1. Then run a few commands in the terminal:
$ php artisan vendor:publish
  1. Add the script in your blade's head
<script src="{{ asset('vendor/lqip/lazysizes/lazysizes.min.js')}}" async=""></script>
<style>
	.blur-up {
		-webkit-filter: blur(25px);
		filter: blur(25px);
		transition: filter 400ms, -webkit-filter 400ms;
	}

	.blur-up.lazyloaded {
		-webkit-filter: blur(0);
		filter: blur(0);
	}
</style>
  1. Apply your image like this
<img {!! lqip('helloworld.jpg') !!} class="lazyload blur-up" >
  1. Add storage disk at filesystems.php
'lqip' => [
            'driver' => 'local',
            'root' => public_path('uploads/images')
        ],
  1. Change your lqip config at config/lqip.php
return [

    'path' => 'uploads/images',

    'disk' => 'lqip',

    'prefix' => '_lqip',

    'format' => 'jpg',

    'blur' => '99', // 0 to 100

    'quality' => '1' // 0 to 100

];

Remember

Config file's 'path' is used for Image Library Intervention to auto create lqip image. Because, it doesn't support laravel's filesystem. So, your lqip image can be create only in your public folder :(

Note

I just make it for my project requirement. So, it can't be match like what u want.

Credits

License

Laravel LQIP is free for non-commercial use.

Related Packages

approached/laravel-image-optimizer

Image optimizer for laravel

144,104 153
plank/laravel-mediable

A package for easily uploading and attaching media files to models with Laravel

1,642,337 827
barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

26,892,778 2,754
unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMC...

3,540,342 2,152
despark/laravel-image-purify

Laravel wrapper for https://github.com/despark/image-purify

2,372 1