Skip to content
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
2 changes: 1 addition & 1 deletion src/GifCreator/AnimGif.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public function create($frames, $durations = self::DEFAULT_DURATION, $loop = 0)
}

if ($i == 0) {
$this->transparent_color = imagecolortransparent($resourceImg);
$this->transparent_color = -1;
}

for ($j = (13 + 3 * (2 << (ord($this->frameSources[$i] { 10 }) & 0x07))), $k = TRUE; $k; $j++) {
Expand Down
43 changes: 34 additions & 9 deletions test/index.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
<?php
// Example for creating a slideshow from images in the "./img/" dir.
<?
function check_images($path,$extension) {
$dir = opendir($path);
$files = array();
while ($current = readdir($dir)) {
if ($current != "." && $current != "..") {
if (is_dir($path . $current)) {
showFiles($path . $current . '/');
}
else {
if(substr($current,-3)==$extension){
$files[] = $current;

}


}
}
}
return $files;
}

require "../src/GifCreator/AnimGif.php";
if(check_images("img","jpg")!=null && check_images("img","jpg")!="" || check_images("img","png")!=null && check_images("img","png")!=""){
// Example for creating a slideshow from images in the "./img/" dir.
require "../src/GifCreator/AnimGif.php";

$anim = new GifCreator\AnimGif();
$anim = new GifCreator\AnimGif();


// Load all images from "./img/", in ascending order,
// apply the given delays, and save the result...

$anim -> create("img/", array(300, 500)) // first 3s, then 5s for all the others
// Load all images from "./img/", in ascending order,
// apply the given delays, and save the result...

$anim -> create("img/", array(30)) // first 3s, then 5s for all the others
-> save("anim.gif");


}
else{
print "Folder empty!";
}
?>