Download the PHP package salopot/image-generator without Composer
On this page you can find all versions of the php package salopot/image-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download salopot/image-generator
More information about salopot/image-generator
Files in salopot/image-generator
Package image-generator
Short Description Image provider for Faker: solid color, gradient, gallery, LoremPixel, PicsumPhotos, Unsplash, LoremFlickr, PlaceKitten, PlaceImg
License MIT
Informations about the package image-generator
Image generator
Image provider for fzaninotto/Faker package with support multiple image sources and basic image manipulations
Local (fast & no need internet connection):
- SolidColor - generate image filled single color
- Gallery - use local directory with images as source
- Gradient - generate gradient image
Remote:
- LoremPixel - lorempixel.com used in the original faker (very unstable now)
- PicsumPhotos - picsum.photos
- Unsplash - unsplash.com
- LoremFlickr - loremflickr.com
- PlaceKitten - placekitten.com
- PlaceImg - placeimg.com Warning: selector param use image resizing
Description
- Support multiple local & remote sources (also you can write own)
- Support basic image manipulations
- Support several result formats (data-url, file, content)
- Support multiple extensions
Requirements
- PHP >=7.1
- GD Library (>=2.0)
- Imagick PHP extension (>=6.5.7)
Installation
Configuration
Usage
Basic example
Group random images for get the same with different changes
Choose one of the available sources.
Support same image manipulations from any source:
Support several output formats:
Laravel
The easiest to register faker with new configuration in Laravel: add next lines to the method app/Providers/AppServiceProvider.php::register
After that you can use faker (with ImageGenerator) in all standard laravel ways via DI: factories, resolve(\Faker\Generator::class), constructor injection