aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Parse/EDID.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Parse/EDID.pm b/lib/Parse/EDID.pm
index cf13475..0e45cd2 100755
--- a/lib/Parse/EDID.pm
+++ b/lib/Parse/EDID.pm
@@ -514,7 +514,10 @@ sub parse_edid {
# if the mm size given in the detailed_timing is not far from the cm size
# put it as a more precise cm size
- my %in_cm = map { $_ => $h->{$_ . '_image_size'} / 10 } ('horizontal', 'vertical');
+ my %in_cm = (
+ horizontal => _define($h->{horizontal_image_size}) / 10,
+ vertical => _define($h->{vertical_image_size}) / 10,
+ );
my ($error) = sort { $b <=> $a } map { abs($edid{'max_size_' . $_} - $in_cm{$_}) } keys %in_cm;
if ($error <= 0.5) {
$edid{'max_size_' . $_} = $in_cm{$_} foreach keys %in_cm;
@@ -632,6 +635,7 @@ sub find_edid_in_string {
@edids;
}
+sub _define { defined $_[0] ? $_[0] : 0 }
sub _sqr { $_[0] * $_[0] }
sub _round { int($_[0] + 0.5) }
sub _group_by2 {