|
13 | 13 |
|
14 | 14 | $image = Vips\Image::newFromFile($argv[1]);
|
15 | 15 | $text = Vips\Image::text($argv[3], ["dpi" => 300, "rgba" => true]);
|
16 | | -$animation = NULL; |
| 16 | +$animation = null; |
17 | 17 | $delay = [];
|
18 | 18 |
|
19 | | -for ($x = 0; $x < $image->width + $text->width; $x += 10) |
20 | | -{ |
| 19 | +for ($x = 0; $x < $image->width + $text->width; $x += 10) { |
21 | 20 | // append the frame to the image vertically ... we make a very tall, thin
|
22 | 21 | // strip of frames to save
|
23 | 22 | $frame = $image->composite2($text, "over", [
|
24 | 23 | "x" => $x - $text->width,
|
25 | 24 | "y" => $image->height / 2 - $text->height / 2
|
26 | 25 | ]);
|
27 | | - if ($animation == NULL) |
| 26 | + if ($animation == null) { |
28 | 27 | $animation = $frame;
|
29 | | - else |
| 28 | + } |
| 29 | + else { |
30 | 30 | $animation = $animation->join($frame, "vertical");
|
| 31 | + } |
31 | 32 |
|
32 | 33 | // frame delay in ms
|
33 | 34 | array_push($delay, 30);
|
|
0 commit comments