PHPackages                             glicer/lazyload-img - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. glicer/lazyload-img

ActiveLibrary

glicer/lazyload-img
===================

lazy loading images

622HTML

Since Oct 2Pushed 9y ago1 watchersCompare

[ Source](https://github.com/emmanuelroecker/php-lazyload-img)[ Packagist](https://packagist.org/packages/glicer/lazyload-img)[ RSS](/packages/glicer-lazyload-img/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-lazyload-img
================

[](#php-lazyload-img)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d39aec2a6d1674f3acfc988ecebe8b21018d75d1ccaef969e5c194001f7a6b4a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f656d6d616e75656c726f65636b65722f7068702d6c617a796c6f61642d696d672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/emmanuelroecker/php-lazyload-img/?branch=master)[![Build Status](https://camo.githubusercontent.com/b1c16d54872e2224945b926ffe4dd8ab6600e389217fa5c61c00f6ce87ee0f4c/68747470733a2f2f7472617669732d63692e6f72672f656d6d616e75656c726f65636b65722f7068702d6c617a796c6f61642d696d672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/emmanuelroecker/php-lazyload-img)[![Coverage Status](https://camo.githubusercontent.com/4bc1e055b43eb3be5706dd46903e094fb6027e3519cf3ee7eea5dda99f8fd0e0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f656d6d616e75656c726f65636b65722f7068702d6c617a796c6f61642d696d672f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/emmanuelroecker/php-lazyload-img?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/63b24b0742baeb75c3659f2fa92b3ae9db23462a08cb8c0a2c233a098dbd93fd/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f65646638316138372d393665372d343632302d623465302d3437643735633032623731642f6d696e692e706e67)](https://insight.sensiolabs.com/projects/edf81a87-96e7-4620-b4e0-47d75c02b71d)[![Dependency Status](https://camo.githubusercontent.com/15169907c8190b8f81df993a0b65b0bd626d3638ac43f13034afd9458b20f0ff/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3537636438306261393638643634303033333630326161352f62616467652e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/user/projects/57cd80ba968d640033602aa5)

Autoset html tags/attributes to lazy loading lossless/lossy images (gif, png, jpeg)

Server side with PHP
--------------------

[](#server-side-with-php)

### Using a blank image and set width/height

[](#using-a-blank-image-and-set-widthheight)

- Add 1x1 gif blank image in data:uri attribute to all ![]() tags in html
- Set width and height attributes with original image size (Browser is going to rescale automatically with width/height attribute)

```
$html = '';

$lazyload = new GlLazyLoadImg(__DIR__); //root directory parameter for relative url

$result = $lazyload->autoDataURI($html);
```

$result contain :

```
>

```

### Using a lossy image and set width/height

[](#using-a-lossy-image-and-set-widthheight)

- Add reduced gif image in data:uri attribute to all ![]() tags in html
- Set width and height attributes with original image size (Browser is going to rescale automatically with width/height attribute)

```
$html = '';

$lazyload = new GlLazyLoadImg(__DIR__,GlLazyLoadImg::LOSSY); //root directory parameter for relative url

$result = $lazyload->autoDataURI($html);
```

$result contain :

```
>

```

Client side with javascript
---------------------------

[](#client-side-with-javascript)

By example, you can use [LazyLoad (aka Vanilla LazyLoad)](https://github.com/verlok/lazyload)

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b48b243005db06852ef61705057d6bd36303e8e39d75191bb4c2c53c0823a2ea?d=identicon)[emmanuelroecker](/maintainers/emmanuelroecker)

### Embed Badge

![Health badge](/badges/glicer-lazyload-img/health.svg)

```
[![Health](https://phpackages.com/badges/glicer-lazyload-img/health.svg)](https://phpackages.com/packages/glicer-lazyload-img)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
