marcandreappel / imagecache
Image resizing and caching
2.3.0
2019-02-19 15:35 UTC
Requires
- php: >=7.0.0
- intervention/image: 2.4.2
- marcandreappel/textr: 1.1.2
This package is auto-updated.
Last update: 2024-10-23 11:05:21 UTC
README
Fast image handling and caching.
$imageCache = new \MarcAndreAppel\ImageCache\ImageCache('/absolute/path/to/base_folder/images'); // Create a scaled and cropped thumbnail and return the public thumbnail path $thumbnail = $imageCache->thumbnail(50, 50)->cachedImage;
Methods (chainable)
Cache path naming override
$imageCache->method('replacement')->thumbnail(50, 50)->publicPath;
Returns /.cache/replacement instead of /.cache/thumbnail/50/50.
Cache path prefixing
$imageCache->prefix('mycache')->thumbnail(50, 50)->publicPath;
Adds /.cache/mycache to the resulting path, eg: /.cache/mycache/thumbnail/50/50.
Allow enlarging of images
$imageCache->enlarge(true)->scale(1200);
Original size might be 400px ✕ 300px and hence becomes bigger.
Create visible subfolders
$imageCache->hidden(false)->scale(1200);