File Coverage

blib/lib/Image/Processor/CD.pm
Criterion Covered Total %
statement 6 32 18.7
branch 0 14 0.0
condition n/a
subroutine 2 5 40.0
pod 0 3 0.0
total 8 54 14.8


line stmt bran cond sub pod time code
1             package Image::Processor::CD;
2            
3 1     1   4 use strict;
  1         2  
  1         28  
4 1     1   4 use base ( 'Image::Processor::Base' );
  1         1  
  1         384  
5            
6             # this module handles interaction with the
7             # KodakCD format CD that you can get with
8             # your photos. It is added to allow for
9             # people that haven't taken advatage of the
10             # Kodak online service
11            
12             sub cd_type {
13 0     0 0   my ($self,$set) = @_;
14 0 0         return $self->{'cd_type'} if !$set;
15 0           $self->{'cd_type'} = $set;
16             }
17            
18             sub read_info_cd {
19 0     0 0   my ($self) = @_;
20             # should be something like
21             #Disc = KODAK PICTURE CD
22             #NumberOfImagesSession2 = 25
23             #LabIdentifier = ORK1
24             #MachineId = ORL-KCDFS2
25             #BatchId = 002137
26             #OrderId = 263577
27             #Date = 2000:08:28 13:41:45
28             #AccessCode = NONE
29 0 0         if (!$self->cdrom) { return };
  0            
30 0           my $file_to_open;
31            
32 0 0         if (-e $self->cdrom . "/INFO.CD") {
33 0           $file_to_open = $self->cdrom . "/INFO.CD";
34 0           $self->cd_type('kodak');
35             }
36 0 0         if (-e $self->cdrom . "/order.txt") {
37 0           $file_to_open = $self->cdrom . "/order.txt";
38 0           $self->cd_type('wal-mart');
39             }
40            
41 0 0         open(INFO,$file_to_open) or $self->graceful_exit( "\nI had a problem opening the info file\n" . $! );
42 0           print "Accessing CD information\n";
43 0           while () {
44 0           $_ =~ s/\s+$//;
45 0           my ($k,$v) = split/\s?=\s?/,$_;
46 0           $k = lc($k);
47 0           $self->{$k} = $v;
48             }
49 0 0         if ($self->{'orderid'} eq '') {
50 0           $self->bad_info();
51             }
52             }
53            
54             sub bad_info {
55 0     0 0   my ($self) = @_;
56 0           print "The CD was not valid, please try another drive or CD\n\n";
57 0 0         if ($self->running_in eq 'console') {
58 0           $self->console_get_drive();
59             } else {
60            
61             }
62             }
63            
64             1;
65            
66             __END__