Changeset 17779
- Timestamp:
- Sep 6, 2012, 5:44:55 PM (12 years ago)
- Location:
- extensions/edit_gmaps
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/edit_gmaps/admin/admin_edit.php
r17777 r17779 104 104 if (count($collection)>0 ) 105 105 if (isset($_POST['update']) && $_POST['update']==l10n('update_exif')){ 106 /******************************* 106 /*********************************** 107 107 * Mise à jour des meta données 108 ******************************* /108 ************************************/ 109 109 // error_reporting ( 0 ); 110 110 // Hide any unknown EXIF tags … … 141 141 //================================================================= 142 142 $infos_gps = array(); 143 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ; 143 $lat = trim($_POST['lat']); 144 $lon = trim($_POST['lon']); 145 $alt = ''; 146 if(isset($_POST['alt'])) 147 $alt = trim($_POST['alt']); 148 149 if($image['lat']=='' || $image['lon']==''){ 150 $image['lat']=$lat; 151 $image['lon']=$lon; 152 $image['alt']=$alt; 153 } 154 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ; 155 144 156 if($image['lat']=='' || $image['lon']==''){ 145 157 $image['lat']=$infos_gps['lat']; … … 165 177 if( cl_edit_controler::add_meta_gps($new_ps_file_info_array,$image)){ 166 178 $exif = @read_exif_data( $image['path']); 167 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false ) ;168 $info_message .=l10n('update_exif') . " : " . $image['path'] . " : " . $image['file'] . " : ok<BR />";179 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ; 180 $info_message .=l10n('update_exif') . " : " . $image['path'] . " : " . $image['file'] . " : ok<BR />"; 169 181 }else{ 170 182 … … 191 203 if($lat !="") cl_edit_controler::add_data_base($collection,$lat,$lon,$alt) ; 192 204 $_POST['submit'] = l10n('selectAction') ; 205 unset($_POST['submit']); 193 206 foreach ($collection as $id_0){ 194 207 foreach ($images as $image) { 195 208 if (array_search($id_0,$image)) { 196 $image['lat'] = 197 $image['lon']= $lon ;198 $image['alt'] = $alt ;209 $image['lat'] = $lat ; 210 $image['lon']= $lon ; 211 $image['alt'] = $alt ; 199 212 } 200 213 } … … 234 247 //======================================================================== 235 248 $v_exif=""; 236 $current = $template->get_template_vars('thumbnails'); 237 $j=0; 238 $thumbnails= array(); 239 foreach ($images as $image){ 249 $current = $template->get_template_vars('thumbnails'); 250 $j=0; 251 $thumbnails= array(); 252 /************************************* 253 * AFFICHAGE MODE GLOBAL 254 *************************************/ 255 foreach ($images as $image){ 240 256 $infos_gps = array(); 241 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ; 257 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ; 258 242 259 $v_exif=$infos_gps['is_exif']?"EXIF":"NO" ; 243 260 $v_db=false ; … … 252 269 $sel_img= array($image['id']); 253 270 if ($new){ 254 255 cl_edit_controler::add_data_base( $sel_img,$image['lat'],$image['lon'],$image['alt']) ; 271 cl_edit_controler::add_data_base( $sel_img,$image['lat'],$image['lon'],$image['alt']) ; 256 272 } 257 273 } … … 347 363 foreach ($images as $image) { 348 364 if (array_search($id_0,$image)) { 349 $infos_gps = array(); 350 if($image['lat']=='' || $image['lon']==''){ }365 366 $infos_gps = array(); 351 367 $infos_gps =array(); 352 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false) ; 353 if(isset($infos_gps['lat']) && $infos_gps['is_exif']){ 354 $image['lat']=$infos_gps['lat']; 355 $image['lon']=$infos_gps['lon']; 356 $image['alt']=$infos_gps['alt']; 357 } 358 if ( $init_info && $image['lat'] <> '' ) { 368 $infos_gps = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,false) ; 369 370 if(isset($infos_gps['lat']) && $infos_gps['is_exif']){ 371 //======= test affichage BD ================ 372 if($image['lat']=='' || $image['lon']==''){ 373 $image['lat']=$infos_gps['lat']; 374 $image['lon']=$infos_gps['lon']; 375 $image['alt']=$infos_gps['alt']; 376 } 377 } 378 //========================================== 379 380 if ( $init_info && $image['lat'] <> '' ) { 381 359 382 $init_info = false ; 360 383 $lat = ($image['lat'] <> '') ? $image['lat'] : '100' ; … … 381 404 $v_db=false ; 382 405 $v_db=$lon!=0 && $lat!=0; 406 383 407 $tpl_var = array_merge( 384 408 $image, … … 424 448 if (!empty($infos_gps)) 425 449 $Position = $infos_gps ; 426 else $Position = cl_edit_controler::Get_exif_gps($filename,$image,false) ; 450 else 451 $Position = cl_edit_controler::Get_exif_gps($filename,$image,false,true) ; 427 452 428 453 $jpeg_header_data = get_jpeg_header_data($filename ); -
extensions/edit_gmaps/admin/admin_edit.tpl
r17776 r17779 77 77 title="{'selection'|@translate}|{'hlp_line3'|@translate}."; 78 78 value="{'selection'|@translate}" ; 79 message='<p><input class="cluetip submit" type="submit" name="submit" title="'+ title +'" value="'+ value +'" /> '; 79 message ='<p><input class="cluetip submit" type="submit" name="submit" title="'+ title +'" value="'+ value +'" /> '; 80 81 82 83 title="{'update_exif'|@translate}|{'hlp_line3'|@translate}."; 84 value="{'update_exif'|@translate}" ; 85 message +='<input class="cluetip submit" type="submit" name="update" title="'+ title +'" value="'+ value +'" /> '; 80 86 81 87 message+='</p>'; 88 82 89 jQuery("#permitAction").append(message); 83 90 -
extensions/edit_gmaps/edit_gmaps.inc.php
r17776 r17779 75 75 foreach( $new_ps_file_info_array['selection'] as $filename ) { 76 76 //====================================================== 77 if($new_ps_file_info_array['lat']=='') { 78 79 $new_ps_file_info_array['lat']=$image['lat']; 80 $new_ps_file_info_array['lon']=$image['lon']; 81 $new_ps_file_info_array['alt']=$image['alt']; 82 } 77 83 if($new_ps_file_info_array['lat']=='') { 78 84 $erreur_message .= "Error - lon or lat = null : $filename <br>\n"; … … 129 135 } 130 136 //========================================================== 131 static public function Get_exif_gps($firt_image,$image,$hight_gps ) {137 static public function Get_exif_gps($firt_image,$image,$hight_gps,$lecture_exif) { 132 138 global $errors;global $template ; 133 139 global $info_message ; … … 148 154 if(count($exif)==0) return ; 149 155 //==================================================================== 156 if(!$lecture_exif){ 150 157 $lat = $image['lat'] ; 151 158 $lon = $image['lon'] ; 152 159 $alt = $image['alt']; 153 160 } 154 161 $p1=base_to_meta($image); 155 162 … … 249 256 pwg_query($update_query) ; 250 257 cl_meta_invalidate_cache(); 251 $info_message .= l10n('update') . " " . implode(',',$sel) . " ". IMAGES_TABLE . " : " . l10n('OK') ."<br />";258 $info_message .= l10n('update') . "[DB] " . implode(',',$sel) . " ". IMAGES_TABLE . " : " . l10n('OK') ."<br />"; 252 259 } 253 260 } -
extensions/edit_gmaps/main.inc.php
r17761 r17779 2 2 /* 3 3 Plugin Name: Edit Maps&Earth 4 Version: 2.2. 44 Version: 2.2.5 5 5 Description: Editor for rv gmaps 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=330
Note: See TracChangeset
for help on using the changeset viewer.