Module: EXIF GPS

Austin519

Joined: 2005-09-26
Posts: 22
Posted: Sat, 2011-07-09 01:33

I'm not entirely sure why guys, but trying to display a map of GPS coordinates for all of my pictures does not work (it loads and shows an empty space where you would expect the map), while I've confirmed that smaller albums work fine. I upgraded to the latest version of the plugin that's attached in the previous post and dumped my exif_coordinates table and ran the extraction again, so I'm not sure what's going on. Any ideas?

Austin519

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sat, 2011-07-09 04:49
Austin519 wrote:
I'm not entirely sure why guys, but trying to display a map of GPS coordinates for all of my pictures does not work (it loads and shows an empty space where you would expect the map), while I've confirmed that smaller albums work fine. I upgraded to the latest version of the plugin that's attached in the previous post and dumped my exif_coordinates table and ran the extraction again, so I'm not sure what's going on. Any ideas?

Austin519

Sounds like the PHP script is timing out before it finishes loading the coordinates for all the photos. If you have your own server, you can increase the limit in the php.ini file:
http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time

 
wellensittich

Joined: 2011-07-14
Posts: 8
Posted: Fri, 2011-07-15 17:39

Hello

whould you support Openstreetmap.org as aditional layer? or use maybee openlayers from OSM without google api?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Fri, 2011-07-15 18:31
wellensittich wrote:
Hello

whould you support Openstreetmap.org as aditional layer? or use maybee openlayers from OSM without google api?

Is there a benefit to using either of those solutions over google?

 
kakkalla

Joined: 2011-08-27
Posts: 1
Posted: Sat, 2011-08-27 13:55

Hello all. I have been using Gallery for all of 4 hours so does the word newbie mean anything to you? :)

Thank you so much for such a great piece of software and an amazing module. I downloaded this EXIF GPS module and installed it without a problem.

At the time of the installation, I only had 5 photos in 1 album that were added with the Server Add option. When I ran the maintenance to have this module extract the information from my existing photos, no map or anything was shown on the page.

I deleted all the photos from the album, did the Server add again and Voila! The map and everything was there.

Did I do something wrong? Why didn't the information come across without having to delete and reimport the pics?

Thanks in advance and thanks again for this brilliant module.

 
Eyeless

Joined: 2009-04-17
Posts: 14
Posted: Mon, 2011-08-29 10:08
Quote:
Is there a benefit to using either of those solutions over google?

The benefit would be the licensing. OSM is not a closed box and there are no privacy concerns (Sure it's just sending coordinates to Google and nothing else, but many are concerned what google does with this information). Next this it provides (often) more information than google maps, since contributing new way/places/etc. is easier. And last but not least, I think there is no API key required, so the plugin works out of the box and you don't have to register yourself (at the company where some people have privacy concerns) for getting it working.

I really like your module, but I also would appreciate openstreetmap maps! ;)

I also have a little feature request would it be possible to map backwards? Meaning if you click on a dot at the map the corresponding album is opened? I didn't thought of this when using yoiur module, but I recognized half of my friends seeing the little map are trying to do exactly that and are astonished that it's not working. Is this a hard task to realise ?

Cheers Eyeless

 
Eyeless

Joined: 2009-04-17
Posts: 14
Posted: Mon, 2011-08-29 10:16
Quote:
I also have a little feature request would it be possible to map backwards? Meaning if you click on a dot at the map the corresponding album is opened? I didn't thought of this when using yoiur module, but I recognized half of my friends seeing the little map are trying to do exactly that and are astonished that it's not working. Is this a hard task to realise ?

Sorry for this, I now see, that it's working if I click on Map * , but somehow the overview map is no not showing anymore. I will have a look at this during the evening. And provide a german translation for the map* links. I thought this would be for mapping an entire album. :)

Cheers Eyeless

 
flint42

Joined: 2011-09-13
Posts: 4
Posted: Tue, 2011-09-13 11:29

Hello;

I dont know if this has been already addressed, i searched the archives, but did not find anything about:
My installation is 3.0.2 with exif gps version 2.
It works fine except when an image has a tag. if it's the case, the sidebar is broken and the server returns an error 500..

If i disable exif gps, tags works fine.
I'v tried with different themes, but there is no incidence it seems.

The output page simply stops during the sidebar. No errors in apache error log, no errors in the gallery logs/ directory.

Is there something i can do in order to debug this ? I don't see why those two modules (Tags and EXIF GPS) can cause this behavior.

Error 500 happens when clicking in a tagged image, and also when clicking on a tag to see all tagged images.

 
flint42

Joined: 2011-09-13
Posts: 4
Posted: Tue, 2011-09-13 12:18

i activated the error report:

Quote:
Kohana_PHP_Exception [ Fatal Error ]: Class 'Tags_gps_Model' not found

SYSPATH/libraries/ORM.php[ 88 ]


    83 public static function factory($model, $id = NULL) 
    84 { 
    85 // Set class name 
    86 $model = ucfirst($model).'_Model';
    87 
    88 return new $model($id); 
    89 } 
    90 
    91 /** 
    92 * Prepares the model database connection and loads the object. 
    93 *
    

{Appel interne PHP} » Kohana_PHP_Exception_Core::shutdown_handler( arguments )

SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments )

SYSPATH/core/Kohana.php[ 549 ] » Event_Core::run( arguments )

{Appel interne PHP} » Kohana_Core::shutdown()

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2011-09-13 16:57
Quote:
Kohana_PHP_Exception [ Fatal Error ]: Class 'Tags_gps_Model' not found

Tags_gps_Model is part of tagsmap not exif_gps. Do you have both modules installed? The model file should be at
gallery3/modules/tagsmap/models/tags_gps.php. If you do have the tagsmap module installed, is this file missing?

 
flint42

Joined: 2011-09-13
Posts: 4
Posted: Tue, 2011-09-13 21:50

This module was not installed, and installing exif_gps did not triggered any dependency warnings... i installed tagsmap and now i have no error anymore.

Thanks !!

 
flint42

Joined: 2011-09-13
Posts: 4
Posted: Tue, 2011-09-13 22:20

there is two references to this model in exif_gps:

grep -Ri  "Tags_gps" exif_gps
exif_gps/helpers/exif_gps_block.php:              $tagsGPS = ORM::factory("tags_gps")->where("tag_id", "=", $oneTag->id)->find();
exif_gps/helpers/exif_gps_block.php:        $tagsGPS = ORM::factory("tags_gps")->where("tag_id", "=", $theme->tag()->id)->find();

thanks again.

 
rmohrbacher

Joined: 2011-07-11
Posts: 5
Posted: Thu, 2011-10-27 13:20

I have a lot of images in my gallery and want to geo-tag many of them manually. For this, I search the locations on google-maps and copy the google-map-links. The latitude and longitude are coded in this Google links like this: ...&ll=1.234,5.578&....

It's strenuous to copy the latitude and longitude and paste it separate into the accordant fields in gallery.

To speed-up this task, i have added a third field for the complete google-maps-url and extract the latitude and longitude after the submit:

modules/exif_gps/helpers/exif_gps_event.php

    if ($record->loaded()) { 
      $gpsdata->input("latitude")->label(t("Latitude")) 
           ->value($record->latitude); 
      $gpsdata->input("longitude")->label(t("Longitude")) 
           ->value($record->longitude); 
    } else { 
      $gpsdata->input("latitude")->label(t("Latitude")); 
      $gpsdata->input("longitude")->label(t("Longitude")); 
    } 
    // additional field: 
    $gpsdata->input("googleUrl")->label(t("GMapsURL"));

    // ...

  static function item_edit_form_completed($item, $form) { 
    // Update the db records with the user-specified coordinates. 
 
    // additional code: 
    if (preg_match("/(\&|\?)ll=(\-?[0-9\.]+),(\-?[0-9\.]+)\&/",$form->edit_item->gps_data->googleUrl->value,$coordinates)){ 
      $form->edit_item->gps_data->latitude->value = $coordinates[2]; 
      $form->edit_item->gps_data->longitude->value = $coordinates[3]; 
    } 
    //...

 
garz

Joined: 2011-11-12
Posts: 1
Posted: Sat, 2011-11-12 10:46

Hello @rWatcher,

Thanks for the exif_gps module, it is really great. I currently use it on a rather large gallery (8200 photos), and the exif_gps sidebar map really slows down the display of the root album (5s instead of less of 1s) : so I used the patch from mr_hyde to hide the map if the item is an album with sub-albums.

If you plan on enhancing the display speed for big albums, I would suggest to create the "LatLngBounds" javascript data structure from a json structure fetched from the server (XHR request), instead of creating it "staticly" by generating JS code from php. This way, the album page would be rendered quickly. Once the page would be loaded in the browser, the location data would be pulled from the server.
I'll try to code this myself, unfortunately I don't have a lot of time :-(

Thank you again.

 
emja

Joined: 2011-11-20
Posts: 1
Posted: Sun, 2011-11-20 02:52

Howdy rWatcher

I've noted a bug in exif_gps. The 'Map This Album' feature does not display in some circumstances. From my testing it looks like it doesn't work if there are sub-albums of the album being mapped, however this is not consistent. It could be due to the number of items within each album but I have not been able to do enough testing to confirm that.

Test1: Sub-album contains ~400 images, maps fine.
Test2: Parent album contains 26 sub-albums (totalling ~2500 images), produces no map output.
Test3: Sub-album contains ~400 images and one sub-album containing a single image, maps fine.
Test4: Parent album contains a single image, 26 sub-albums (totalling ~2500 images), produces no map output.

Note that the side-bar map works consistently in all cases.

Any advice appreciated.

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Fri, 2011-11-25 10:40

After using Gallery 1 and Gallery 2 for years now, I decided to take the leap to Gallery 3, even though a proper WPG2 alternative is not in existance yet (causing me to apply the layout of my WordPress site to the Gallery theme). But this module is totally making it worth, especially since I geotag my photos since 2007. It's much faster than the Gallery 2 Google Maps Plugin. I already made a quick-and-dirty customization to allow routes in .kmz files to be displayed on the main maps.

However, I'm looking to change one more thing: I'd like to have slightly smaller markers and markers for an album in a different colour. Is this possible and where to start?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Fri, 2011-11-25 19:18
BorgKing wrote:
After using Gallery 1 and Gallery 2 for years now, I decided to take the leap to Gallery 3, even though a proper WPG2 alternative is not in existance yet (causing me to apply the layout of my WordPress site to the Gallery theme). But this module is totally making it worth, especially since I geotag my photos since 2007. It's much faster than the Gallery 2 Google Maps Plugin. I already made a quick-and-dirty customization to allow routes in .kmz files to be displayed on the main maps.

However, I'm looking to change one more thing: I'd like to have slightly smaller markers and markers for an album in a different colour. Is this possible and where to start?

Does this help?
http://www.powerhut.co.uk/googlemaps/custom_markers.php

 
BorgKing
BorgKing's picture

Joined: 2002-09-12
Posts: 314
Posted: Wed, 2011-11-30 12:02

That helped indeed, although it was a little more complicated determining how to distinguish between photos and albums. But I managed that too :) Please let me know if I've done something that goes completely against Gallery coding principles.

I made the following changes to modules/exif_gps/views/exif_gps_map.html.php:

After the following line:
var glatlngbounds = new google.maps.LatLngBounds( ); // This is so we can auto center the map.
insert:

    var pinColourAlbum = "FF9900";
    var pinColourPhoto = "FFFF00";    
    var pinIconAlbum = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + pinColourAlbum,
      null,
      null,
      null,
      new google.maps.Size(14, 23));
    var pinIconPhoto = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + pinColourPhoto,
      null,
      null,
      null,
      new google.maps.Size(14, 23));
    var pinShadowAlbum = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",
      null,
      null,
      new google.maps.Point(9, 25),
      new google.maps.Size(27, 25));     
    var pinShadowPhoto = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_shadow",
      null,
      null,
      new google.maps.Point(9, 25),
      new google.maps.Size(27, 25));

And replace the following 2 occurrences of:
map: map
by:

          map: map,
          <? if ($item->is_album()) { ?>
          icon: pinIconAlbum,
          shadow: pinShadowAlbum
          <? } else { ?>
          icon: pinIconPhoto,
          shadow: pinShadowPhoto
          <? } ?>
 
xeta

Joined: 2011-11-24
Posts: 42
Posted: Thu, 2011-12-29 07:59

This is really a great module, and to be honest, this module made it possible that I switched from 4images to Gallery3

In Addition to the normal function of the module I display a bigger map under the foto.

I copied the code into the photo.html

<script type="text/javascript" src="http://www.google.com/jsapi?key=<?= module::get_var("googlemap_api_key"); ?>"></script>
<script type="text/javascript">
    function initialize() {
    var latlng = new google.maps.LatLng(<?=$latitude; ?>,<?=$longitude; ?>);
    var myOptions = {
      zoom: 20,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("sidebar_map_canvas"),
        myOptions);
  }

  google.setOnLoadCallback(initialize);

</script>
  <div id="sidebar_map_canvas" style="width:800px; height:400px"></div>

I know this way is not the best option, but for me it is working.

Is there any way that I can set my own options for Zoom and Maptype, because does not matter which options I set in var myOptions, always the values from the module are used.

I also tried to rename (document.getElementById("sidebar_map_canvas") and <div id="sidebar_map_canvas" to another map_name but in this case there is no map displayed.

Thanks in advance

www.xeta.at

 
ostein

Joined: 2006-01-19
Posts: 2
Posted: Sun, 2012-02-26 13:53

Great module!

However with my new install of Gallery3 I can't use it anymore: It still asks for an API-Key but google doesn't issue them anymore. My old (still working) key was generated for another URL, so currently I'm a bit lost.

Any idea?

Thanks in advance!

cheers

Oliver

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2012-03-12 22:55

You can use an API console key instead:
https://code.google.com/apis/console

ostein wrote:
Great module!

However with my new install of Gallery3 I can't use it anymore: It still asks for an API-Key but google doesn't issue them anymore. My old (still working) key was generated for another URL, so currently I'm a bit lost.

Any idea?

Thanks in advance!

cheers

Oliver

 
meulie
meulie's picture

Joined: 2003-09-12
Posts: 60
Posted: Thu, 2012-03-15 09:16
xeta wrote:
This is really a great module, and to be honest, this module made it possible that I switched from 4images to Gallery3

In Addition to the normal function of the module I display a bigger map under the foto.

I copied the code into the photo.html

<script type="text/javascript" src="http://www.google.com/jsapi?key=<?= module::get_var("googlemap_api_key"); ?>"></script>
<script type="text/javascript">
    function initialize() {
    var latlng = new google.maps.LatLng(<?=$latitude; ?>,<?=$longitude; ?>);
    var myOptions = {
      zoom: 20,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("sidebar_map_canvas"),
        myOptions);
  }

  google.setOnLoadCallback(initialize);

</script>
  <div id="sidebar_map_canvas" style="width:800px; height:400px"></div>

I know this way is not the best option, but for me it is working.

Is there any way that I can set my own options for Zoom and Maptype, because does not matter which options I set in var myOptions, always the values from the module are used.

I also tried to rename (document.getElementById("sidebar_map_canvas") and <div id="sidebar_map_canvas" to another map_name but in this case there is no map displayed.

Thanks in advance

www.xeta.at

Where in photo.html.php did you insert this? I'd love to give it a try myself as well :-)

Regards,
Evert

 
sealeh

Joined: 2012-04-23
Posts: 1
Posted: Mon, 2012-04-23 08:24

Hello there.

Is it just me or is this addon currently a bit out of date? After following the installation instructions and enabling both addons (exif and exif_gps) I get no sidebar whatsoever when I open an image which I know contain EXIF GPS data. When configuring the addon, it asks me for the Google Maps API key - which I know is deprecated. So I'm wondering if the addon perhaps needs an update?

Or am I missing something...?

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Mon, 2012-04-23 13:09
rWatcher wrote:
You can use an API console key instead:
https://code.google.com/apis/console

ostein wrote:
Great module!

However with my new install of Gallery3 I can't use it anymore: It still asks for an API-Key but google doesn't issue them anymore. My old (still working) key was generated for another URL, so currently I'm a bit lost.

Any idea?

Thanks in advance!

cheers

Oliver

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2012-04-24 04:09

Does the docs need to be updated. I can do this if somebody makes a suggestion if they don't feel comfortable doing so.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Wed, 2012-05-02 02:30

When trying to map a user's pictures, I get this error:

2012-05-01 22:06:26 -04:00 --- error: Undefined variable: return_url
#0 /usr/local/src/gallery3-contrib/3.0/modules/exif_gps/views/exif_gps_map.html.php(93): gallery_error_Core::error_handler(8, 'Undefined varia...', '/usr/local/src/...', 93, Array)
#1 /av/gallery3/system/libraries/View.php(318): include('/usr/local/src/...')
#2 /av/gallery3/system/libraries/View.php(260): View_Core->load_view('/usr/local/src/...', Array)

As a quick hack, I fixed it in exif_gps.php by setting return_url when not mapping an album:

    if (isset($curr_album))
        $template->content->return_url = url::abs_site("{$curr_album[0]->type}s/{$curr_album[0]->id}");
    else
        $template->content->return_url = url::abs_site("");

I'm not sure why my setup would have this issue if it doesn't afflict others.

Fixing that, I have the problem mentioned by others in this thread when trying to map a large number of pictures - a blank page. It doesn't seem to be related to a timeout (I've increased the timeout settings and the blank page occurs inside of the timeout) and nothing occurs in the G3 logs, even though I've enabled debugging. Any thoughts on how to debug what might be going on?

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Fri, 2012-05-04 01:48

It seems to be related to the volume of data produced. I can make things work alright if I modify exif_gps_map.html.php to only add more than one picture at a given coordinate if there aren't too many, ie:

      <? } elseif (count($items) < 500) { ?>
        <? $windowContent = $windowContent . " <div class=\\\"g-exif-gps-thumb\\\"><a href=\\\"" . 
                            $item->url() . "\\\">" . 
                            str_replace("\"", "\\\"", $item->thumb_img(array("class" => "g-exif-gps-thumbnail"))) . 
                            "</a></div>"; ?>
      <? } ?>

Additionally, since each call to glatlngbounds.extend seems to produce some javascript, rather than calling it for each item, it reduces the amount of data to only call it if the coordinates have changed.
Still, I have no idea where the limitation is here...some aspect of PHP's output buffering?

rWatcher, any opinions on these changes?

 
draik

Joined: 2012-05-28
Posts: 1
Posted: Mon, 2012-05-28 04:14

I used the exiftool to geotag my pictures. When I uploaded them to my gallery3 site, the coordinates were reversed; latitude as longitude, and vice-versa. Elsewhere, the exif GPS information reads correctly, but not when imported to gallery3 or seen through the Exif GPS Data module. Is there a fix for this?

EDIT: Looking at the exif_coordinates database table, the "-" stayed with longitude, but the latitude's numerical value was still swapped with the longitude's numerical value.

Correct:
Longitude: -54.321
Latitude: 12.345

exif_coordinates:
Longitude: -12.345
Latitude: 54.321

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2012-05-31 05:24

Would it be possible for you to post a sample photo with non-working coordinates so I can try and debug this?

draik wrote:
I used the exiftool to geotag my pictures. When I uploaded them to my gallery3 site, the coordinates were reversed; latitude as longitude, and vice-versa. Elsewhere, the exif GPS information reads correctly, but not when imported to gallery3 or seen through the Exif GPS Data module. Is there a fix for this?

EDIT: Looking at the exif_coordinates database table, the "-" stayed with longitude, but the latitude's numerical value was still swapped with the longitude's numerical value.

Correct:
Longitude: -54.321
Latitude: 12.345

exif_coordinates:
Longitude: -12.345
Latitude: 54.321

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-06-19 00:06

EXIF_GPS Version 3:
- Changed references to Google Maps API key to Google APIs Console key, made console key optional (if you're using a key, you'll want to activate the "Google Maps API v3" and "Static Maps API" services).
- Added option to restrict viewing maps to registered users (off by default).
- Added a map to user profile pages.
- Added breadcrumbs to map pages.
- Completely re-written javascript code -- gps coordinates are now loaded from a seperate file after the page loads. The overall pages should now load faster, although you might be stuck with a loading screen for a while when there's _lots_ of coordinates to display. This applies to the map pages, user profile pages, and dynamic sidebar option for photos/albums/movies.
- Also, when zoomed out, gps coordinates that are close together will be grouped together.
[img]http://gallery.menalto.com/files/exif_gps_loading.png[/img]

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Wed, 2012-06-20 00:54

v3 looks great but hasn't been all that happy so far on my machine. Hitting the map button for an album leads to an error about items being undefined on line 121 of exif_gps.php. I don't know enough php to tell what might be going on here...I don't see another items variable in scope. Trying to hit the save button on the settings page leads to an error on line 57 of admin_exif_gps.php about an undefined offset of 0.

On an unrelated (I think?) note I had to add a couple of 'static' annotations to the _can_view_profile_pages routines in rwinfo_theme.php and rwinfo_block.php for the rwinfo module (I think I picked up a new version as well when I git pulled from gallery3-contrib).

Any ideas?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2012-06-20 18:45
cchiappa wrote:
v3 looks great but hasn't been all that happy so far on my machine. Hitting the map button for an album leads to an error about items being undefined on line 121 of exif_gps.php. I don't know enough php to tell what might be going on here...I don't see another items variable in scope.

I am unable to reproduce this error on my end, but I think I see the problem -- it should hopefully be fixed now.

cchiappa wrote:
Trying to hit the save button on the settings page leads to an error on line 57 of admin_exif_gps.php about an undefined offset of 0.

Also unable to reproduce this error, and that line is the same between version 2 and version 3. I tweaked the code some though, if you had the "Show Map this user icon?" box unchecked when you got the error, then it might be fixed. If you still get the error let me know and I'll look at it some more.

Here's the updated module:
http://gallery.menalto.com/files/exif_gps.zip

cchiappa wrote:
On an unrelated (I think?) note I had to add a couple of 'static' annotations to the _can_view_profile_pages routines in rwinfo_theme.php and rwinfo_block.php for the rwinfo module (I think I picked up a new version as well when I git pulled from gallery3-contrib).

I modified rWInfo to make the "Owner" field into a link to that user's profile, if profile's are viewable. That's weird that you're getting an error there, I copied that function out of gallery core, and it definitely doesn't say static there (line 83):
http://github.com/gallery/gallery3/blob/master/modules/gallery/controllers/user_profile.php
I've updated the code on my end to say "static private function _can_view_profile_pages($user)" so that should be fine now.

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Fri, 2012-06-22 02:49
rWatcher wrote:
cchiappa wrote:
v3 looks great but hasn't been all that happy so far on my machine. Hitting the map button for an album leads to an error about items being undefined on line 121 of exif_gps.php.

I am unable to reproduce this error on my end, but I think I see the problem -- it should hopefully be fixed now.

Yup, that looks good now.

rWatcher wrote:
cchiappa wrote:
Trying to hit the save button on the settings page leads to an error on line 57 of admin_exif_gps.php about an undefined offset of 0.

Also unable to reproduce this error, and that line is the same between version 2 and version 3. I tweaked the code some though, if you had the "Show Map this user icon?" box unchecked when you got the error, then it might be fixed. If you still get the error let me know and I'll look at it some more.

That error was still there but I was able to work around it by checking isset in the loops in question, ie:

      if (count($form->Global->toolbar_map_user) > 0) {
        for ($i = 0; $i < count($form->Global->toolbar_map_user); $i++) {
          if (isset($form->Global->toolbar_map_user->value[$i]) &&
              ($form->Global->toolbar_map_user->value[$i] == "checkbox_user")) {
            $checkbox_user = true;
          }
        }
      }

As I said, I don't know php so I don't know what the rules are, but this seems to make it work. I run Debian Unstable which seems to have a newer version of php than most (php5 5.4.4-rc1) and I've had to make a few changes to G3/modules to make it happy.

With all of this, the new version looks great! It seems to choke up a little when trying to map tens of thousands of points, but works on more reasonable requests.

One other problem: putting the “Exif GPS Maps” block in the sidebar causes none of the sidebar to be displayed, but I don't see any errors at all in either the web server log or the G3 log. The “EXIF GPS Location” block works fine however.

Thanks for an awesome module!

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Fri, 2012-06-22 17:13
cchiappa wrote:
rWatcher wrote:
cchiappa wrote:
Trying to hit the save button on the settings page leads to an error on line 57 of admin_exif_gps.php about an undefined offset of 0.

Also unable to reproduce this error, and that line is the same between version 2 and version 3. I tweaked the code some though, if you had the "Show Map this user icon?" box unchecked when you got the error, then it might be fixed. If you still get the error let me know and I'll look at it some more.

That error was still there but I was able to work around it by checking isset in the loops in question

I've reworked this code to remove those loops, everything should be fine now.

cchiappa wrote:
With all of this, the new version looks great! It seems to choke up a little when trying to map tens of thousands of points, but works on more reasonable requests.

Does "choke up a little" mean it takes a while to load the map, or does it break completely? I don't think there's anything I can do to speed up processing thousands of points, but if it's breaking completely I can look into improving the loading code.

cchiappa wrote:
One other problem: putting the “Exif GPS Maps” block in the sidebar causes none of the sidebar to be displayed, but I don't see any errors at all in either the web server log or the G3 log. The “EXIF GPS Location” block works fine however.

Thanks for an awesome module!

That's weird, I don't see anything that would cause the sidebar to crash like that. I've added a few extra isset calls, does that help any?
http://gallery.menalto.com/files/exif_gps.zip

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Sun, 2012-06-24 01:00
rWatcher wrote:
Does "choke up a little" mean it takes a while to load the map, or does it break completely? I don't think there's anything I can do to speed up processing thousands of points, but if it's breaking completely I can look into improving the loading code.

I'm hesitant to necessarily say it's a bug in the module - watching the server, I see apache and mysql spin for a while as the client says "loading." When that's done it thinks for a bit and a few markers appear. At some point later some more markers might appear as well, but it seems like sometimes not all of them do. So it could be some weird quirk on the client side as well. I'll try to poke aronud at it some more and see if I can characterize it.

rWatcher wrote:
That's weird, I don't see anything that would cause the sidebar to crash like that. I've added a few extra isset calls, does that help any?
http://gallery.menalto.com/files/exif_gps.zip

The download link is giving me a "page not found" now. Anyone else?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sun, 2012-06-24 04:29
cchiappa wrote:
I'm hesitant to necessarily say it's a bug in the module - watching the server, I see apache and mysql spin for a while as the client says "loading." When that's done it thinks for a bit and a few markers appear. At some point later some more markers might appear as well, but it seems like sometimes not all of them do. So it could be some weird quirk on the client side as well. I'll try to poke aronud at it some more and see if I can characterize it.

It's possible you might be running up against some kind of php execution limit, so that it's only loading some of the records before timing out. If that's the case, I can probably rework the code to load a few hundred at a time instead of all the records. I'll have to think about how best to do that.

cchiappa wrote:
The download link is giving me a "page not found" now. Anyone else?

Sorry, should be fixed now.

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Mon, 2012-06-25 00:42

The new module version does fix the problems I was having saving the settings, thanks. The sidebar is still broken, however, with nothing in the webserver or g3 logs. This isn't a big enough deal that I'm inclined to spend any time on it, but am happy to try anything if you have suggestions.

rWatcher wrote:
It's possible you might be running up against some kind of php execution limit, so that it's only loading some of the records before timing out. If that's the case, I can probably rework the code to load a few hundred at a time instead of all the records. I'll have to think about how best to do that.

It doesn't seem to me like it's a php timeout - the server spins for a little over a minute when querying my whole gallery (timeout should be two minutes) and there are no errors in my logs. After the server stops processing, the client displays a couple of individual markers for pictures, but no clusters, and is not consuming CPU. Sliding the map around with the mouse causes it to display the clusters, although not necessarily all at once.

A different error I just started getting: Sometimes the map instead displays “An AJAX error occured: parsererror\nError: undefined.” Nothing in either log.

As a side note, while the server is processing, it seems like the majority of CPU time (80%?) is in the apache process which implies that the database query is not super expensive, but the php processing is?

This is on a gallery with about 45,000 images, of which about 16,000 have EXIF coordinates.

 
grantiago

Joined: 2002-08-23
Posts: 78
Posted: Tue, 2012-06-26 19:29

i keep getting this error when I run the extract exif gps from the maintenance page g3:

Quote:
Task Extract Exif GPS data started (task id 129)
exception 'ORM_Validation_Exception' with message 'ORM Validation has failed for items model' in /home/amaralg/public_html/system/libraries/ORM_Validation_Exception.php:20
Stack trace:
#0 /home/me/public_html/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation('items', Object(Validation))
#1 /home/me/public_html/modules/gallery/models/item.php(773): ORM_Core->validate(NULL)
and so on...

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2012-06-28 00:39
grantiago wrote:
i keep getting this error when I run the extract exif gps from the maintenance page g3:

Quote:
Task Extract Exif GPS data started (task id 129)
exception 'ORM_Validation_Exception' with message 'ORM Validation has failed for items model' in /home/amaralg/public_html/system/libraries/ORM_Validation_Exception.php:20
Stack trace:
#0 /home/me/public_html/system/libraries/ORM.php(755): ORM_Validation_Exception_Core::handle_validation('items', Object(Validation))
#1 /home/me/public_html/modules/gallery/models/item.php(773): ORM_Core->validate(NULL)
and so on...

I'm unable to reproduce this on my end. What version of Gallery are you using?

cchiappa wrote:
A different error I just started getting: Sometimes the map instead displays “An AJAX error occured: parsererror\nError: undefined.” Nothing in either log.

Sounds like it's having trouble processing the XML data. Either there's a character in there that's not being escaped properly (shouldn't happen, but you'd get this error every single time if it was the issue), or else maybe php is cutting out in the middle of printing the XML data, causing errors that way.

I've updated the module to process records 1000 at a time instead of all at once, so if something is timing out, this should fix it. I've also added a "% complete" counter onto the "Loading..." message -- should make it easier to see if it's still loading or not.
http://gallery.menalto.com/files/exif_gps.zip

 
CJ00TA

Joined: 2010-03-31
Posts: 34
Posted: Wed, 2012-07-04 18:24

I seem to be having an issue / bug.

I've set my Gallery to "Map This Album" and to *NOT* "Map This User"

[img]http://www.2000transam.com/temp/7-4-20121-11-20PM.jpg[/img]

However.. I'm showing a map user link in my side bar.

[img]http://www.2000transam.com/temp/7-4-20121-12-10PM.jpg[/img]

Running G3 3.0.4

What am I doing wrong?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2012-07-05 03:00
CJ00TA wrote:
I seem to be having an issue / bug.

I've set my Gallery to "Map This Album" and to *NOT* "Map This User"

"Show Map this album icon?" and "Show Map this user icon?" control the display of icons at the top of the page, not the sidebar links.
[img]http://gallery.menalto.com/files/exif_gps_map_icons.png[/img]
If you wanted to remove the user link from the sidebar, you'd have to manually delete lines 6-8 in /modules/exif_gps/views/exif_gps_maps_sidebar.html.php.

 
CJ00TA

Joined: 2010-03-31
Posts: 34
Posted: Thu, 2012-07-05 04:17
rWatcher wrote:
If you wanted to remove the user link from the sidebar, you'd have to manually delete lines 6-8 in /modules/exif_gps/views/exif_gps_maps_sidebar.html.php.

Thanks!

That's exactly what I was looking for - (removing the sidebar links)

 
CJ00TA

Joined: 2010-03-31
Posts: 34
Posted: Tue, 2012-08-07 07:17

I seem to be having another issue...

My sidebar maps now load to either 53% or 93% then blank out to a grey map with absolutely nothing displayed when I'm at or near my root folders. If I drill down all the way inside an album with say 100 pictures in it, it starts working.

I've added about 1300 pictures from my trip to Italy, and it seems to have killed it. I have somewhere around 2000 pictures that are location tagged.

Any ideas? I've already set my max execution time to 900 seconds.

Can I rebuild the exif gps database? If so.. how?

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-08-14 00:22
CJ00TA wrote:
I seem to be having another issue...

My sidebar maps now load to either 53% or 93% then blank out to a grey map with absolutely nothing displayed when I'm at or near my root folders. If I drill down all the way inside an album with say 100 pictures in it, it starts working.

I've added about 1300 pictures from my trip to Italy, and it seems to have killed it. I have somewhere around 2000 pictures that are location tagged.

Any ideas? I've already set my max execution time to 900 seconds.

Can I rebuild the exif gps database? If so.. how?

It looks like the problem might be caused by a few photos with invalid coordinates. I've sent you a PM with the specifics. You could delete and re-install the module, then use the maintenance screen to re-populate the database, but there's no guarantee that the photos with bad coordinates won't cause problems the second time around. I think the best solution in this cause would be to just manually edit the coordinates of the few photos that are causing issues from the Photo options -> Edit photo menu.

 
CJ00TA

Joined: 2010-03-31
Posts: 34
Posted: Wed, 2012-08-15 13:39

Thanks for the PM rWatcher - I'm good now. Thank you!

For the rest of you with maybe similar issues - I have a 5Dmk3 with the GP-E2 module tagging my images. I was getting invalid geolocation from the GP-E2 module when it was running more than 90* vertical. For example, I was in the Vatican taking pictures in the museum areas looking up. The problem I was having is that when the GP-E2 goes more than 90*, it freaks and gives invalid data.

 
milchkuh

Joined: 2012-10-05
Posts: 1
Posted: Fri, 2012-10-05 12:15

Hi there!

I have a problem regarding maps that map is showing when I log into gallery using http but using SSL the map is not loading. Any solution for this problem?

 
maddogz

Joined: 2012-11-04
Posts: 1
Posted: Sat, 2012-11-10 18:37

*Nevermind* I didn't have the latest version of Gallery 3 installed. Installing that fixed my issues. I'll leave this post, in case someone else has this issue.

I am trying to convert from G2 to G3, and have been running both in parallel for quite some time, waiting on something like this to completely my transition to G3. I have the side bar working perfectly, where I can see and interact with the mini map. I've setup a Google API key for it, though I'm not sure if it needs a Browser or Server key. I'm pretty sure I've enabled the V2 and V3 APIs along with the Static Maps API. The mini map on the side bar is great. If the end map works like that, I'm impressed enough to leave my G2 site behind.

However, my problem is with the larger map. When I click Map this Album in the main album, I get a 500 error in Chrome and IE. If I use the shortcut at the top for viewing the map, I get the google map, but no data points on it. I was getting an api V2 error in IE at one point, so I'm pretty sure I have the API key, but I"m unsure why the behavior of the shortcut is different than the Map this Album link, and why neither is working. I downloaded the latest copy from this forum and installed over top of the previous version. Any other ideas?

 
trashmans
trashmans's picture

Joined: 2012-11-14
Posts: 1
Posted: Wed, 2012-11-14 23:02

I'm having the same issue. When using EXIF GPS with HTTP it works with no problem, but when used with SSL / HTTPS it just displays a loading screen.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2012-12-12 00:55

I've posted an Updated version of EXIF_GPS, which includes bozek's fix for excessive database queries, as discussed here:
http://gallery.menalto.com/node/109227#comment-399841

The updated module can be downloaded from the first post, or my github account.
http://gallery.menalto.com/files/exif_gps.zip

 
xeta

Joined: 2011-11-24
Posts: 42
Posted: Tue, 2013-02-26 06:41

I am using the last version of this module. Since the upgrade 3.0.5 Ihave a really strange problem. In Firefox, Chrome and Opera the clustered map and (http://www.xeta.at/Namibia) in the albums fails and the User map (http://www.xeta.at/exif_gps/map/user/2) usuallly fails withe the following error "An AJAX error occured: error Error: undefined". The strange thing is that every 20 reload it is working from time to time and it usually it also works with the IE10.

With tools like Firebug I was not able to identifiy the problem. Maybe somebody can help me with this issue?

www.xeta.at