From 1b0fd8048f11cfa99660819822cad6bff5ce4238 Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Mon, 12 Jan 2009 19:12:45 +0000 Subject: [PATCH] google maps link for geotagged photos --- include/gallery.css | 13 +++++++++++++ include/smallglobe.png | Bin 0 -> 445 bytes mkgallery.pl | 33 +++++++++++++++++++++++++++------ 3 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 include/smallglobe.png diff --git a/include/gallery.css b/include/gallery.css index 44e360d..96800a8 100644 --- a/include/gallery.css +++ b/include/gallery.css @@ -292,3 +292,16 @@ table.picframe { color: #FFF; text-align: left; } + +div.slideimage { + position: relative; +} + +div.geoloc { + position: absolute; + right: 0px; + top: 0px; + width: 14px; + height: 14px; + background: url(smallglobe.png) no-repeat; +} diff --git a/include/smallglobe.png b/include/smallglobe.png new file mode 100644 index 0000000000000000000000000000000000000000..0f135ffe14bafb1bfa0814dc26807923c948849a GIT binary patch literal 445 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xamSQK*5Dp-y;YjHK@;M7UB8!1^ zDF`z@KE$31WJs2{MwA5SrEalo zF){a&q4ym}0oD)q<=Pi4c)`BGV4IVdwKl7xXKH?-fJ;tLB+Hfl#B@y##z5|ab{VRR zDkdZ>R1^@pc$r!BNlf?b?*E7XA2_t(^Sv{-=c+$nQ*6*-`p4lI_qoS;8@Qttd>@Lx zyXeHcf3c%-R&cC~4_kt{hp9}GZ2ZTT{KlC)eRVNO#wxLjq8)n|CMgCIW zdd^cn?wk$%pt%2?fJ_-XP!WJ*>QK3*U={-fullpath}; return 0 unless ( -f $fullpath ); + + if ($havegeoloc) { + my $exif = new Image::ExifTool; + $exif->ExtractInfo($fullpath); + my ($la,$lo) = $exif->GetLocation(); + if ($la && $lo) { + $self->{-geoloc} = [$la,$lo]; + } + } + my $info = image_info($fullpath); if (my $error = $info->{error}) { if (($error !~ "Unrecognized file format") && @@ -785,20 +798,28 @@ sub img_entry { $self->{-parent}->{-numofimgs}++; print $IND a({-name=>$name}),"\n", - start_table({-class=>'slide'}),start_Tr,start_td,"\n", - div({-class=>'slidetitle'}, + start_table({-class=>'slide'}),start_Tr,start_td,"\n"; + print $IND div({-class=>'slidetitle'}, "\n ",a({-href=>".html/$name-info.html", -title=>'Image Info: '.$name, -class=>'infoBox'}, $title),"\n"),"\n", - div({-class=>'slideimage'}, - "\n ",a({-href=>".html/$name-static.html", + start_div({-class=>'slideimage'}); + if ($self->{-geoloc}) { + my ($la,$lo) = @{$self->{-geoloc}}; + print $IND a({-href=>"http://maps.google.com/". + "?q=$la,$lo&ll=$la,$lo", + -title=>"$la,$lo", + -class=>'geoloc'}, + div({-class=>'geoloc'},"G")),"\n"; + } + print $IND a({-href=>".html/$name-static.html", -title=>$title, -class=>'showImage', -rel=>'i'.$name}, img({-src=>$thumb, -class=>'thumbnail', - -alt=>$title})),"\n"),"\n", + -alt=>$title})),"\n",end_div, start_div({-class=>'varimages',-id=>'i'.$name,-title=>$title}),"\n"; foreach my $sz(@sizes) { my $src=$self->{$sz}->{'url'}; -- 2.39.2