File: 002_graphlibs.t

package info (click to toggle)
libapache-gallery-perl 0.99-svn060811-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, squeeze
  • size: 536 kB
  • ctags: 24
  • sloc: perl: 1,128; makefile: 60; sh: 13
file content (28 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use Test::More;
use Apache::Gallery;
use Image::Size qw(imgsize);

eval { require Apache::FakeRequest; };
if ($@) {
  plan skip_all => 'skip Apache::FakeRequest not found';
}
else {

  plan tests => 4;

  my $request = Apache::FakeRequest->new('get_remote_host' => 'localhost');

	Apache::Gallery::resizepicture($request, 't/002_inpng.png', 't/inpng-resized.png', 10, 10, 0, '');
	Apache::Gallery::resizepicture($request, 't/002_injpg.jpg', 't/injpg-resized.jpg', 10, 10, 0, '');
	my ($pngwidth, $pngheight)=imgsize('t/inpng-resized.png');
	my ($jpgwidth, $jpgheight)=imgsize('t/injpg-resized.jpg');

	is  ($pngwidth, 10, 'PNG Width') or diag('You need to install libpng before libimlib');
	is  ($pngheight, 10, 'PNG Height') or diag('You need to install libpng before libimlib');
	is  ($jpgwidth, 10, 'JPG Width') or diag('You need to install libjpeg before libimlib');
	is  ($jpgheight, 10, 'JPG Height') or diag('You need to install libjpeg before libimlib');

	unlink('t/inpng-resized.png');
	unlink('t/injpg-resized.jpg');

}