line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# $Id$ |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# image::convert Brik |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
package Metabrik::Image::Convert; |
7
|
1
|
|
|
1
|
|
566
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
8
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
5
|
use base qw(Metabrik::Shell::Command Metabrik::System::Package); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
440
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub brik_properties { |
13
|
|
|
|
|
|
|
return { |
14
|
0
|
|
|
0
|
1
|
|
revision => '$Revision$', |
15
|
|
|
|
|
|
|
tags => [ qw(unstable) ], |
16
|
|
|
|
|
|
|
author => 'GomoR ', |
17
|
|
|
|
|
|
|
license => 'http://opensource.org/licenses/BSD-3-Clause', |
18
|
|
|
|
|
|
|
attributes => { |
19
|
|
|
|
|
|
|
output => [ qw(file) ], |
20
|
|
|
|
|
|
|
delay => [ qw(microseconds) ], |
21
|
|
|
|
|
|
|
}, |
22
|
|
|
|
|
|
|
attributes_default => { |
23
|
|
|
|
|
|
|
delay => 50, |
24
|
|
|
|
|
|
|
}, |
25
|
|
|
|
|
|
|
commands => { |
26
|
|
|
|
|
|
|
install => [ ], # Inherited |
27
|
|
|
|
|
|
|
to_animated_gif => [ qw($files output|OPTIONAL delay|OPTIONAL) ], |
28
|
|
|
|
|
|
|
}, |
29
|
|
|
|
|
|
|
require_binaries => { |
30
|
|
|
|
|
|
|
'convert' => [ ], |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
need_packages => { |
33
|
|
|
|
|
|
|
ubuntu => [ qw(imagemagick) ], |
34
|
|
|
|
|
|
|
debian => [ qw(imagemagick) ], |
35
|
|
|
|
|
|
|
kali => [ qw(imagemagick) ], |
36
|
|
|
|
|
|
|
}, |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub to_animated_gif { |
41
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
42
|
0
|
|
|
|
|
|
my ($files, $output, $delay) = @_; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
0
|
|
|
|
$output ||= $self->output; |
45
|
0
|
|
0
|
|
|
|
$delay ||= $self->delay; |
46
|
0
|
0
|
|
|
|
|
$self->brik_help_run_undef_arg('to_animated_gif', $files) or return; |
47
|
0
|
0
|
|
|
|
|
$self->brik_help_run_invalid_arg('to_animated_gif', $files, 'ARRAY') or return; |
48
|
0
|
0
|
|
|
|
|
$self->brik_help_run_empty_array_arg('to_animated_gif', $files) or return; |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my $file_list = join(' ', @$files); |
51
|
0
|
0
|
|
|
|
|
$self->execute("convert -delay $delay -loop 0 $file_list $output") or return; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return $output; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |