Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation update, browser interop fix for $loop == 1, fix input check of $durations array in create() #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This class helps you to create an animated GIF image: give multiple images and t
**1 - Creation:**

```php
// Create an array containing file paths, resource var (initialized with imagecreatefromXXX),
// Create an array containing file paths, resource var (initialized with imagecreatefromXXX),
// image URLs or even binary code from image files.
// All sorted in order to appear.
$frames = array(
Expand All @@ -23,11 +23,11 @@ $frames = array(
'http://thisisafakedomain.com/images/pic4.jpg', // URL
);

// Create an array containing the duration (in millisecond) of each frames (in order too)
// Create an array containing the duration (in centiseconds (hundredths of a second)) of each frames (in order too)
$durations = array(40, 80, 40, 20);

// Initialize and create the GIF !
$gc = new GifCreator();
$gc = new GifCreator\GifCreator();
$gc->create($frames, $durations, 5);
```
The 3rd parameter of create() method allows you to choose the number of loop of your animated gif before it stops.
Expand Down Expand Up @@ -59,9 +59,9 @@ file_put_contents('/myfolder/animated_picture.gif', $gifBinary);
### Behavior

- The transparency is based on the first given frame. It will be saved only if you give multiple frames with same transparent background.
- The dimensions of the generated GIF are based on the first frame. If you need to resize your frames to get the same dimension, you can use
- The dimensions of the generated GIF are based on the first frame. If you need to resize your frames to get the same dimension, you can use
this class: https://github.com/Sybio/ImageWorkshop

### About

The class reuses some part of code of "GIFEncoder.class.php" by László Zsidi (thanks to him).
The class reuses some part of code of "GIFEncoder.class.php" by László Zsidi (thanks to him).
Loading