summaryrefslogtreecommitdiff
path: root/config_files/picasa_faces.config
diff options
context:
space:
mode:
authorexiftool <phil@work3.phy.queensu.ca>2016-01-22 10:48:20 -0500
committerexiftool <phil@work3.phy.queensu.ca>2016-01-22 10:48:20 -0500
commitacc0117a4d12fd19eb56b19f23546c3b5c8dbb9c (patch)
tree1e8709879164a123bbf241696c30efcb4e229bfa /config_files/picasa_faces.config
parent3d84ce1a1ff7975b983e361780f63b8cc318c70d (diff)
Update to 10.10
Diffstat (limited to 'config_files/picasa_faces.config')
-rw-r--r--config_files/picasa_faces.config19
1 files changed, 10 insertions, 9 deletions
diff --git a/config_files/picasa_faces.config b/config_files/picasa_faces.config
index fb32d516..0fccd92e 100644
--- a/config_files/picasa_faces.config
+++ b/config_files/picasa_faces.config
@@ -62,6 +62,7 @@
# is not rotated.
# 2015/05/12 - PH Minor code tweaks
# 2015/10/26 - BKW Round off area sizes to 7 decimal places
+# 2016/01/18 - BKW Improved rounding algorithm
#
# References: http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,6354.0.html
#------------------------------------------------------------------------------
@@ -142,17 +143,17 @@ sub LoadPicasaFiles($$)
# for compatibility with 32-bit systems.
my $hi = hex(substr($1, 0, -8));
my $lo = hex(substr($1, -8));
- # round to 7 decimals (arbitrary, but seems to be about what Picasa uses)
- my $x0 = int((($hi >> 16) /65535)*10000000+.5)/10000000;
- my $y0 = int((($hi & 0xffff)/65535)*10000000+.5)/10000000;
- my $x1 = int((($lo >> 16) /65535)*10000000+.5)/10000000;
- my $y1 = int((($lo & 0xffff)/65535)*10000000+.5)/10000000;
+ my $x0 = ($hi >> 16) /65535;
+ my $y0 = ($hi & 0xffff)/65535;
+ my $x1 = ($lo >> 16) /65535;
+ my $y1 = ($lo & 0xffff)/65535;
push @{ $fileHash{$section} }, {
ContactID => $2,
- X => $x0,
- Y => $y0,
- W => int(($x1 - $x0)*10000000+.5)/10000000,
- H => int(($y1 - $y0)*10000000+.5)/10000000,
+ # round to 8 decimals (Picasa will ignore regions with greater than 10 decimals)
+ X => int($x0*100000000+.5)/100000000,
+ Y => int($y0*100000000+.5)/100000000,
+ W => int(($x1 - $x0)*100000000+.5)/100000000,
+ H => int(($y1 - $y0)*100000000+.5)/100000000,
};
}
}