An open API service indexing awesome lists of open source software.

https://github.com/tempestphp/responsive-image

Server-side responsive images with PHP
https://github.com/tempestphp/responsive-image

Last synced: about 1 month ago
JSON representation

Server-side responsive images with PHP

Awesome Lists containing this project

README

          

# Responsive images with PHP

Generate responsive images with PHP and render the correct HTML.

> [!IMPORTANT]
> This package is still a work in progress! Feel free to open issues.

## Quickstart

```sh
composer require tempest/responsive-image
```

```php
use Tempest\ResponsiveImage\ResponsiveImageFactory;
use Tempest\ResponsiveImage\ResponsiveImageConfig;

$config = new ResponsiveImageConfig(
srcPath: __DIR__ . '/path/to/image/sources',
publicPath: __DIR__ . '/../public',
);

$imageFactory = new ResponsiveImageFactory($config);

$image = $imageFactory->create('/parrot.jpg');

echo $image->html;

//
```

## In depth

Read the full docs here: [https://tempestphp.com/docs/packages/responsive-image](https://tempestphp.com/docs/packages/responsive-image)