| 1 |
#!perl -w |
| 2 |
use strict; |
| 3 |
use Test::More tests => 4; |
| 4 |
use Imager; |
| 5 |
use Imager::Test qw(test_image); |
| 6 |
|
| 7 |
# giflib 4.2.0 and 5.0.0 had a bug with producing the wrong |
| 8 |
# GIF87a/GIF89a header, test we get the right header |
| 9 |
# https://rt.cpan.org/Ticket/Display.html?id=79679 |
| 10 |
# https://sourceforge.net/tracker/?func=detail&aid=3574283&group_id=102202&atid=631304 |
| 11 |
my $im = test_image()->to_paletted(); |
| 12 |
|
| 13 |
{ |
| 14 |
my $data; |
| 15 |
ok($im->write(data => \$data, type => "gif"), |
| 16 |
"write with no tags, should be GIF87a"); |
| 17 |
is(substr($data, 0, 6), "GIF87a", "check header is GIF87a"); |
| 18 |
} |
| 19 |
|
| 20 |
{ |
| 21 |
my $data; |
| 22 |
ok($im->write(data => \$data, type => "gif", gif_loop => 1), |
| 23 |
"write with loop tags, should be GIF89a"); |
| 24 |
is(substr($data, 0, 6), "GIF89a", "check header is GIF89a"); |
| 25 |
} |