File: autocrop.t

package info (click to toggle)
libimage-imlib2-perl 2.02-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 196 kB
  • ctags: 40
  • sloc: perl: 294; ansic: 112; makefile: 75
file content (19 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl -w
use strict;
use Test::More tests => 8;

use_ok('Image::Imlib2');

my $i = Image::Imlib2->load("t/blob.png");
isa_ok($i, 'Image::Imlib2');
my($x, $y, $w, $h) = $i->autocrop_dimensions;
is($x, 128);
is($y, 8);
is($w, 123);
is($h, 200);

my $cropped = $i->autocrop;
is($cropped->width, 123);
is($cropped->height, 200);
$cropped->save("t/cropped.png");