Skip to content

Commit

Permalink
Enhance Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
martinheise committed Jul 19, 2024
1 parent 75aefcd commit d50d617
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

This module contains logic to calculate multiple scaled image sizes from one source image and configuration options. It is meant to create appropriate `srcset`and `sizes` attributes for responsive images that best fit the given image and information about the HTML/CSS context.

It only contains business logic to define the expected sizes. The actual handling of the image data, like resizing, caching of the result etc. is not handled by the module, but done by the calling code, the interface `ImageData` serves as main connection point.
It only contains business logic to define the expected sizes. The actual handling of the image data, like resizing, caching of the result etc. is not handled by the module, but done by the calling code, the interface `ImageData` serves as main connection point.

## Installation

Install with composer:

composer require mhe/imagetools ^1.0

## Usage overview

- Implement interface `Mhe\Imagetools\Data\ImageData` as a wrapper for your images and processing methods
- create a `Mhe\Imagetools\Data\RenderConfig` object holding options and context information like the specific image layout context
```
```
$config = new RenderConfig("max-width: 1000px) 100vw, 1000px", 5, 20000, 2);
```
- create a new `Mhe\Imagetools\ImageResizer` and let it process the source image with given configuration:
Expand Down

0 comments on commit d50d617

Please sign in to comment.