bitheater / dummy-image
Create dummy images
dev-master
2014-12-25 19:49 UTC
Requires
- guzzle/guzzle: ~3.0
- imagine/imagine: ~0.5,<0.7
Requires (Dev)
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2025-03-29 00:23:27 UTC
README
This library is a dummy image generator for your PHP projects. We find it very useful for creating of fixtures for our projects.
Installing
Add the dependency to the composer.json
file:
{ "require": { "bitheater/dummy-image": "dev-master" } }
A minimum working version (for local image generation):
<?php use Bitheater\DummyImage\Generator\LocalGenerator; $generator = new LocalGenerator(ImagineFactory::GD); // You could also use IMAGICK and GMAGICK $result = $generator->generate(__DIR__ . '/image.png');
Local image generation is good when you don't have access to the external service (or maybe you need to create fixtures without internet connection). Local generation needs GD, IMAGICK or GMAGICK installed on your server.
A minimum working version (for remote image generation):
<?php use Bitheater\DummyImage\Generator\RemoteGenerator; use Guzzle\Http\Client; $generator = new RemoteGenerator(new Client()); $result = $generator->generate(__DIR__ . '/image.png');
Remote image generation uses DummyImage website as the generator for the images.
Options
<?php use Bitheater\DummyImage\Generator\LocalGenerator; $generator = new LocalGenerator(ImagineFactory::GD); $result = $generator->generate(__DIR__ . '/image.png');
License
Dummy Image Generator is licensed under the MIT license.