Changeset 7033 for extensions/rv_gmaps
- Timestamp:
- Sep 28, 2010, 10:20:33 PM (14 years ago)
- Location:
- extensions/rv_gmaps/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_gmaps/trunk/admin/admin_sync.php
r3447 r7033 19 19 if ( isset($_POST['submit']) ) 20 20 $sync_options = array( 21 // 'no_overwrite' => isset($_POST['no_overwrite']),22 21 'simulate' => is_adviser() ? true : isset($_POST['simulate']), 22 'use_high' => isset($_POST['use_high']), 23 23 'cat_id' => isset($_POST['cat_id']) ? (int)$_POST['cat_id'] : 0, 24 24 'subcats_included' => isset($_POST['subcats_included']), … … 26 26 else 27 27 $sync_options = array( 28 // 'no_overwrite' => true,29 28 'simulate' => true, 29 'use_high' => true, 30 30 'cat_id' => 0, 31 31 'subcats_included' => true, … … 35 35 if ( isset($_POST['submit']) ) 36 36 { 37 include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php'); 38 37 39 $where_clauses = array(); 38 40 if ( $sync_options['cat_id']!=0 ) … … 48 50 49 51 $query=' 50 SELECT id,path,lat,lon 52 SELECT id,path,lat,lon,has_high 51 53 FROM '.IMAGES_TABLE.' INNER JOIN '.IMAGE_CATEGORY_TABLE.' ON id=image_id 52 54 WHERE category_id IN ('.implode(',', $cat_ids).') … … 56 58 { 57 59 $query=' 58 SELECT id,path,lat,lon 60 SELECT id,path,lat,lon,has_high 59 61 FROM '.IMAGES_TABLE; 60 62 } … … 65 67 foreach ($images as $image) 66 68 { 67 $exif = @read_exif_data( $image['path'] ); 68 if ( empty($exif) ) 69 continue; 70 $exif = array_intersect_key( $exif, array_flip( array('GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude') ) ); 71 if ( count($exif)!=4 ) 72 continue; 73 if ( !in_array($exif['GPSLatitudeRef'], array('S', 'N') ) ) 74 { 75 $errors[] = $image['path']. ': GPSLatitudeRef not S or N'; 76 continue; 77 } 78 if ( !in_array($exif['GPSLongitudeRef'], array('W', 'E') ) ) 79 { 80 $errors[] = $image['path']. ': GPSLongitudeRef not W or E'; 81 continue; 82 } 83 if (!is_array($exif['GPSLatitude']) or !is_array($exif['GPSLongitude']) ) 84 { 85 $errors[] = $image['path']. ': GPSLatitude and GPSLongitude are not arrays'; 86 continue; 87 } 88 $lat = parse_lat_lon( $exif['GPSLatitude'] ); 89 if ( $exif['GPSLatitudeRef']=='S' ) 90 $lat = -$lat; 91 $lon = parse_lat_lon( $exif['GPSLongitude'] ); 92 if ( $exif['GPSLongitudeRef']=='W' ) 93 $lon = -$lon; 94 $datas[] = array ( 95 'id' => $image['id'], 96 'lat' => $lat, 97 'lon' => $lon, 98 ); 69 $filename = $image['path']; 70 if ($sync_options['use_high'] and $image['has_high']=='true') 71 $filename = get_high_path($image); 72 $exif = @read_exif_data( $filename ); 73 if ( empty($exif) ) 74 continue; 75 $exif = array_intersect_key( $exif, array_flip( array('GPSLatitudeRef', 'GPSLatitude', 'GPSLongitudeRef', 'GPSLongitude') ) ); 76 if ( count($exif)!=4 ) 77 continue; 78 if ( !in_array($exif['GPSLatitudeRef'], array('S', 'N') ) ) 79 { 80 $errors[] = $filename. ': GPSLatitudeRef not S or N'; 81 continue; 82 } 83 if ( !in_array($exif['GPSLongitudeRef'], array('W', 'E') ) ) 84 { 85 $errors[] = $filename. ': GPSLongitudeRef not W or E'; 86 continue; 87 } 88 if (!is_array($exif['GPSLatitude']) or !is_array($exif['GPSLongitude']) ) 89 { 90 $errors[] = $filename. ': GPSLatitude and GPSLongitude are not arrays'; 91 continue; 92 } 93 $lat = parse_lat_lon( $exif['GPSLatitude'] ); 94 if ( $exif['GPSLatitudeRef']=='S' ) 95 $lat = -$lat; 96 $lon = parse_lat_lon( $exif['GPSLongitude'] ); 97 if ( $exif['GPSLongitudeRef']=='W' ) 98 $lon = -$lon; 99 $datas[] = array ( 100 'id' => $image['id'], 101 'lat' => $lat, 102 'lon' => $lon, 103 ); 99 104 } 100 105 $template->assign( 'sync_errors', $errors ); … … 135 140 $template->assign( 136 141 array( 137 'SUBCATS_INCLUDED_CHECKED' => $sync_options['subcats_included'] ? 'checked="checked"' : '' 142 'SUBCATS_INCLUDED_CHECKED' => $sync_options['subcats_included'] ? 'checked="checked"' : '', 143 'USE_HIGH_CHECKED' => $sync_options['use_high'] ? 'checked="checked"' : '' 138 144 ) 139 145 ); -
extensions/rv_gmaps/trunk/admin/admin_sync.tpl
r6400 r7033 27 27 <ul> 28 28 <li><label><input type="checkbox" name="simulate" value="1" checked="checked" {$TAG_INPUT_ENABLED} /> {'only perform a simulation (no change in database will be made)'|@translate}</label></li> 29 <li><label><input type="checkbox" name="use_high" value="1" {$USE_HIGH_CHECKED} /> use high resolution images if available</label></li> 29 30 </ul> 30 31 </fieldset> -
extensions/rv_gmaps/trunk/changelog.txt
r6651 r7033 1 1 2.1.b 2 - allow gps exif metadata synchronisation with high resolution images 2 3 - fixed admin navigation bar 3 4 - compatible with extended description 4 5 - upgrade prototype 6 - language updates 5 7 6 8 2.1.a -
extensions/rv_gmaps/trunk/main.inc.php
r6400 r7033 1 1 <?php /* 2 2 Plugin Name: RV Maps&Earth 3 Version: 2.1. a3 Version: 2.1.b 4 4 Description: Extend your gallery with Google Maps and Google Earth ... 5 5 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=122 … … 7 7 Author URI: http://www.modusoptimus.com/ 8 8 */ 9 define( 'RVM_PLUGIN_VERSION', '2.1. a');9 define( 'RVM_PLUGIN_VERSION', '2.1.b'); 10 10 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 11 11
Note: See TracChangeset
for help on using the changeset viewer.