]> git.donarmstrong.com Git - deb_pkgs/libapache-gallery-perl.git/blob - t/002_graphlibs.t
[svn-inject] Installing original source of libapache-gallery-perl (0.99-svn060811)
[deb_pkgs/libapache-gallery-perl.git] / t / 002_graphlibs.t
1 use Test::More;
2 use Apache::Gallery;
3 use Image::Size qw(imgsize);
4
5 eval { require Apache::FakeRequest; };
6 if ($@) {
7   plan skip_all => 'skip Apache::FakeRequest not found';
8 }
9 else {
10
11   plan tests => 4;
12
13   my $request = Apache::FakeRequest->new('get_remote_host' => 'localhost');
14
15         Apache::Gallery::resizepicture($request, 't/002_inpng.png', 't/inpng-resized.png', 10, 10, 0, '');
16         Apache::Gallery::resizepicture($request, 't/002_injpg.jpg', 't/injpg-resized.jpg', 10, 10, 0, '');
17         my ($pngwidth, $pngheight)=imgsize('t/inpng-resized.png');
18         my ($jpgwidth, $jpgheight)=imgsize('t/injpg-resized.jpg');
19
20         is  ($pngwidth, 10, 'PNG Width') or diag('You need to install libpng before libimlib');
21         is  ($pngheight, 10, 'PNG Height') or diag('You need to install libpng before libimlib');
22         is  ($jpgwidth, 10, 'JPG Width') or diag('You need to install libjpeg before libimlib');
23         is  ($jpgheight, 10, 'JPG Height') or diag('You need to install libjpeg before libimlib');
24
25         unlink('t/inpng-resized.png');
26         unlink('t/injpg-resized.jpg');
27
28 }