Download the PHP package erikvdven/php-gif without Composer

On this page you can find all versions of the php package erikvdven/php-gif. 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 php-gif

php-gif

Latest Stable Version Donate

IMPORTANT NOTE: This repository is not actively maintained anymore. I moved from PHP to Python years ago, so that's basically why. If you would like to contribute on this repository, feel free to open up a PR and perhaps I can add you as a contributor as well. There are also people who forked this repository and decided to built further on that. For a fork which is compatible with PHP 8, see phpgif/phpgif

Below GIF image is an example image which can contain real-time data. A PHP script calculates the pending time till new year and generates the GIF image. An ideal solution for sending e-mails with real-time data to customers. E-mail clients give you the opportunity to load images by URL and so everytime the client re-opens the e-mail message, the GIF will be re-generated with real-time data.

For below image this doesn't work, unfortunately, because GitHub downloads the image once and stores it locally. Most e-mail clients, however, do load the images directly from source. Successfully tested with Gmail and Outlook 2011 (Mac OSX).

Note

I received some questions about Gmail so lets describe this mail client a bit more in detail. This script is successfully tested with Gmail, at the moment of writing, which is 2015-12-23. Gmail loads the images via their own proxy, so not directly from source. There are different opinions about the proxy, but it seems that Google's proxy protects your private data and only informs the sender that the email has been opened. There are speculations that Gmail caches the images, but still respect the cache headers, so you can instruct Gmail how often to refresh the data. I personally had no trouble with the cache whatsoever! I've tested this countdown image numerous times in Gmail and of course you can test it yourself as well. Just to be sure I've added some cache disabling headers in the examples.

Composer Installation

  1. Get Composer
  2. Require php-gif with composer require erikvdven/php-gif
  3. Add the following to your application's main PHP file: require 'vendor/autoload.php';

Getting Started

Create a PHP file and add these headers at the beginning of the file:

On the next lines you can create a GIF image by first initializing the GIFGenerator object and creating an array with all the image frames:

Finally you generate the image and echo the results on the screen:

Example

A more complete example. You could copy/paste below code to a file and execute it in the browser to view a more complete result. As you can see it's not required to use text in your GIF image and you can add as much text per frame, and as much frames per GIF image as you like.

License & Credits

This software is published under the MIT License.

GIFEncoder

GIFEncoder.class.php contains minor adaptations from the GIFEncoder PHP class by László Zsidi.


All versions of php-gif with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 erikvdven/php-gif contains the following files

Loading the files please wait ....