Branch Coverage

blib/lib/Image/Size.pm
Criterion Covered Total %
branch 48 136 35.2


line true false branch
144 1 22 if (ref $stream eq 'SCALAR') { }
2 20 elsif (ref $stream) { }
174 20 0 unless ($Image::Size::NO_CACHE)
179 20 0 unless ('File::Spec'->file_name_is_absolute($stream))
184 0 20 if (-e "$stream" and exists $Image::Size::CACHE{$stream})
189 0 0 if ($mtime <= $list[0])
201 1 19 unless (open $handle, '<', $stream)
223 22 139 if ($header =~ /$Image::Size::TYPE_MAP[$tm_idx]/)
233 19 3 unless ($Image::Size::NO_CACHE or ref $stream or not defined $x)
240 2 20 if ($need_restore)
245 19 3 if ($need_close)
250 0 22 unless (defined $id)
252 0 0 if ($file_name) { }
264 22 0 wantarray ? :
274 0 0 if (exists $INC{'Graphics/Magick.pm'}) { }
0 0 elsif (exists $INC{'Image/Magick.pm'}) { }
0 0 elsif (_load_magick_module('Graphics::Magick')) { }
0 0 elsif (_load_magick_module('Image::Magick')) { }
292 0 0 if ($module_name) { }
298 0 0 if ("$x") { }
318 0 0 $retval ? :
328 1 0 defined $args[0] ? :
338 1 0 defined $args[0] ? :
348 0 0 if (ref $stream eq 'SCALAR')
382 0 0 if (img_eof($stream))
388 0 0 if ord $lbuf == 0
393 0 5 if ($Image::Size::GIF_BEHAVIOR > 2)
401 0 5 if (length($buf = &$Image::Size::READ_IN($stream, 7)) != 7)
406 5 0 if ($Image::Size::GIF_BEHAVIOR == 0)
411 0 0 if ($x & 128)
414 0 0 unless (&$Image::Size::READ_IN($stream, $cmapsize))
428 0 0 if (img_eof($stream))
434 0 0 if ($sw and $sh) { }
446 0 0 if ($x == 44)
449 0 0 if (length($buf = &$Image::Size::READ_IN($stream, 8)) != 8)
455 0 0 if $Image::Size::GIF_BEHAVIOR == 1
456 0 0 if ($x > $sw and $y > $sh)
462 0 0 if ($x == 33) { }
467 0 0 if ($x == 249) { }
0 0 elsif ($x == 254) { }
0 0 elsif ($x == 1) { }
0 0 elsif ($x == 255) { }
516 1 0 if ($input =~ /^\#define\s*\S*\s*(\d+)\s*\n\#define\s*\S*\s*(\d+)/xi)
538 1 0 if ($line =~ /"\s*(\d+)\s+(\d+)(\s+\d+\s+\d+){1,2}\s*"/)
562 1 0 if (&$Image::Size::READ_IN($stream, $length, $offset) eq 'IHDR')
586 0 0 if (&$Image::Size::READ_IN($stream, $length, $offset) eq 'MHDR')
633 0 8 if ($marker ne $MARKER) { }
2 6 elsif (ord $code >= $SIZE_FIRST and ord $code <= $SIZE_LAST) { }
645 0 2 if length $buf < $length
676 1 0 if ($header =~ /^(?:P([1-7]))\s+(\d+)\s+(\d+)/)
680 0 1 if ($n == 7) { }
706 1 1 if ($header =~ /II\x2a\x00/o)
742 0 4 if $ifd eq '' or $offset > $num_dirent
747 0 4 if $type > @packspec + 0 or not defined $packspec[$type]
748 2 2 if ($tag == 256) { }
2 0 elsif ($tag == 257) { }
761 2 0 if (defined $x and defined $y) { }
768 0 0 unless (defined $x)
772 0 0 unless (defined $y)
774 0 0 if ($id ne '')
798 1 1 if ($header_size == 12) { }
806 2 0 if (defined $x and defined $y)
824 1 0 if (defined $x and defined $y)
859 0 0 if (substr($buffer, 2048, 3) ne 'PCD')
865 0 0 $orient ? :
882 0 1 unless ($retval)
960 0 2 if ($x == 0)
961 0 2 if ($y == 0)