diff options
author | Daniel Friesel <derf@finalrewind.org> | 2013-08-28 21:51:51 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2013-08-28 21:51:51 +0200 |
commit | c69fc4e88af0bfe12c9b4f589309a6e12e5fefc9 (patch) | |
tree | d49832b734291e42a0120e03fb4e45f03c2b9480 /lib/App | |
parent | 9bea66807af13b3ddc2cf9a1b8a5e9b1d58e9abb (diff) |
specify negative no_lines to autocrop png (remove black space)
Diffstat (limited to 'lib/App')
-rw-r--r-- | lib/App/VRR/Fakedisplay.pm.PL | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/App/VRR/Fakedisplay.pm.PL b/lib/App/VRR/Fakedisplay.pm.PL index d051f2c..7969bde 100644 --- a/lib/App/VRR/Fakedisplay.pm.PL +++ b/lib/App/VRR/Fakedisplay.pm.PL @@ -169,6 +169,23 @@ sub new_line { return; } +sub crop_to_content { + my ($self) = @_; + + my $new_im = GD::Image->new($self->{width} * $self->{scale}, + $self->{offset_y} * $self->{scale}, 1); + $new_im->copyResized($self->{image}, 0, 0, 0, 0, + $self->{width} * $self->{scale}, + $self->{offset_y} * $self->{scale}, + $self->{width} * $self->{scale}, + $self->{offset_y} * $self->{scale} + ); + + $self->{image} = $new_im; + + return; +} + sub png { my ($self) = @_; |