Download the PHP package efrontsa/images-generator without Composer

On this page you can find all versions of the php package efrontsa/images-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package images-generator

images-generator

Generator of placeholder-type images using GD for fzaninotto/Faker

Sample image

Build Status

What is the goal of this project?

Faker is an amazing tool to quickly generate bunch of fake data that looks real. You can refer to its documentation to learn more about the powerful things it can do.

One of the great option of Faker is to be able to use LoremPixel to get pretty pictures. It works great but has a few drawbacks:

images-generator comes in order to solve this problem. All pictures are directly generated by your current PHP setup using GD, the almost standard for image manipulation in PHP.

images-generator can gets very useful for unit tests, integration servers, fixtures and many other cases...

Advantages of using images-generator:

Drawbacks of using images-generator:

Installation

The easiest way is to use composer:

composer require bheller/images-generator

Or if you prefer by modifying your composer.json file, add this line to the "require" section:

"bheller/images-generator": "~1.0"

Usage

Use the ImagesGeneratorProvider class in combinaison with Faker to produce new images:

<img src="">

It will generate a black png picture of 640*480 pixels inside your temp directory (if available) and return the full path of the picture like this: '/tmp/13b73edae8443990be1aa8f1a483bc27.png'.

Parameters

The imageGenerator() method has many arguments. Here are the default values:

imageGenerator($dir = null, $width = 640, $height = 480, $format = 'png', $fullPath = true, $text = null, $backgroundColor = null, $textColor = null)

Description:

Examples:

Sample image

Sample image

More complex example using the power of Faker:

Sample image

Seeding the generator

The images-generator doesn't directly uses the seeding power of Faker. But you still can use it to generate the different parameters values. For example, this code will always output the same green picture with the same text (dolorum):

$faker->seed(1234);
$image = $faker->imageGenerator('img', $faker->numberBetween(600, 800), $faker->numberBetween(400, 600), 'jpg', true, $faker->word, $faker->hexColor, $faker->hexColor);

Sample image

Future developments

This is the first release, and it already should work for most usages. But I already have some goals for future releases to come:

Otherwise, any suggestion is welcome! You can fork this project and submit your PR.

Tests

There are no unit tests included currently (see Future developments).

License

images-generator is released under the MIT Licence. See the bundled LICENSE file for details.

The Roboto font file included in this project is under Apache Licence 2.0 as mentioned on the Roboto repository.


All versions of images-generator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
fzaninotto/faker Version ~1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package efrontsa/images-generator contains the following files

Loading the files please wait ....