image-generator

Generate simple placeholder images with a specific size, color, and some text on them. For PHP 8.1 and newer.

MIT License

Downloads
16.9K
Stars
28
Committers
1
image-generator - v3.0.0 Latest Release

Published by nicoverbruggen 3 months ago

  • Requires PHP 8.1 or newer
  • Added a simple test to verify image generation is not broken
  • Added GitHub Actions for running the test(s)
  • Removed the deprecated makePlaceholderImage function (hence the bump to v3)

Full Changelog: https://github.com/nicoverbruggen/image-generator/compare/v2.2.0...v3.0.0

image-generator - v2.2.0

Published by nicoverbruggen 3 months ago

What's Changed

  • Fix deprecated method calling itself (makePlaceholderImage() now correctly calls generate(), although this deprecated function will be removed in v3)
  • When outputting the image to the output buffer, the output buffer is now erased beforehand using ob_clean()
  • Fix warnings for upcoming PHP 8.1 by @mjot in https://github.com/nicoverbruggen/image-generator/pull/4

New Contributors

Full Changelog: https://github.com/nicoverbruggen/image-generator/compare/v2.1.0...v2.2.0

image-generator - v2.1

Published by nicoverbruggen almost 3 years ago

The package has been updated for the upcoming release of PHP 8.1!

This is a simple maintenance release so that there are no more warnings about the following:

  • the loss of precision from implicit casts (float to int)
  • passing null to the third parameter of str_replace is deprecated
image-generator - v2.0.1

Published by nicoverbruggen over 3 years ago

The package has been updated for PHP 8!

What's new

With named parameter support, now you can do this:

(new ImageGenerator(
    targetSize: "150x150",
    fontPath: "/System/Library/Fonts/Supplemental/Arial.ttf",
    fontSize: 20
))->generate(text: "Hello world");

Upgrade instructions

  • The constructor of ImageGenerator has changed, so you will want to adopt named parameters.
  • The method makePlaceholderImage still exists (because it was still in v2.0.0), but it is deprecated in favor of generate.