Image/Jpg.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Image/Exif.pm ↑ Summary Log/Dual.pm »
1 #
2 # $Id$
3 #
4 # image::jpg Brik
5 #
6 package Metabrik::Image::Jpg;
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use base qw(Metabrik::Shell::Command Metabrik::System::Package);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub brik_properties {
13 return {
14 revision => '$Revision$',
15 tags => [ qw(unstable jpeg) ],
16 author => 'GomoR <GomoR[at]metabrik.org>',
17 license => 'http://opensource.org/licenses/BSD-3-Clause',
18 commands => {
19 install => [ ], # Inherited
20 info => [ qw(image.jpg) ],
21 },
22 require_binaries => {
23 'jhead' => [ ],
24 },
25 need_packages => {
26 ubuntu => [ qw(jhead) ],
27 debian => [ qw(jhead) ],
28 kali => [ qw(jhead) ],
29 },
30 };
31 }
32  
33 sub info {
34 my $self = shift;
35 my ($image) = @_;
36  
37 $self->brik_help_run_undef_arg('info', $image) or return;
38 $self->brik_help_run_file_not_found('info', $image) or return;
39  
40 my $cmd = "jhead \"$image\"";
41 my $out = $self->capture($cmd) or return;
42  
43 my $info = {};
44 for my $this (@$out) {
45 my ($key, $val) = $this =~ /^(.*?)\s+:\s+(.*)$/;
46 $self->log->debug("info: key [$key] val [$val]");
47 $key = lc($key);
48 $key =~ s/\s+/_/g;
49 $info->{$key} = $val;
50 }
51  
52 return $info;
53 }
54  
55 1;
56  
57 __END__
« Image/Exif.pm ↑ Summary Log/Dual.pm »