Author Topic: [MOD] Exif V.1.7.6  (Read 189192 times)

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
[MOD] Exif V.1.7.6
« on: March 30, 2008, 07:29:52 PM »
Dieser MOD erweitert die in den Versionen 1.7.6 - 7  enthaltene EXIF funktion um folgende Werte:
 
 Belichtungsabweichung,   
 Blendenöffnungswert,
 Maximaler Blendenöffnungswert,
 Belichtungsmessung,
 Blitz,
 Belichtungsprogramm,
 Belichtungsmodus,
 Weißabgleich,
 GPS Breitengrad, //aus dem MOD von @Erik
 GPS Längengrad,  //aus dem Mod von @Erik
 GPS Track,

zusätzlich werden alle exif informationen in die datenbank geschrieben, und von dort ausgelesen.
somit werden auch dann die exif infos auf der detailseite dargestellt,
wenn mit "checkimages" die bilder verkleinert werden und die originalbilder in den ordner "big" verschoben werden.

DEMO: exif mod

neue Dateien:
 install_exif.php
 member_install_exif.php (new 25.10.2009 )
 checkimages.php (code update 25.10.2009 )
 update_exif_index.php (code update 25.10.2009 )

modifizierte Dateien:
 includes/db_field_definitions.php
 lang/deutsch/main.php
 includes/funktions.php (code update 25.10.2009 )
 admin/checkimages.php (code update 25.10.2009 )
 includes/member.php (new 25.10.2009 )

1.) sucht  in  derincludes/functions.php:

function get_exif_info($exif) {
  
$exif_match = array();
  
$exif_match['Make'] = "make";
  
$exif_match['Model'] = "model";
  
$exif_match['DateTimeOriginal'] = "datetime";
  
$exif_match['ISOSpeedRatings'] = "isospeed";
  
$exif_match['ExposureTime'] = "exposure";
  
$exif_match['FNumber'] = "aperture";
  
$exif_match['FocalLength'] = "focallen";

  
$exif_array = array();
  if (
is_array($exif)) {
    foreach (
$exif as $key => $val) {
      if (isset(
$exif_match[$key])) {
        
$exif_info $val;
        if (
$key == "DateTimeOriginal") {
          
$exif_array[$exif_match[$key]] = preg_replace("/([0-9]{4}):([0-9]{2}):([0-9]{2})/""\\3.\\2.\\1"$exif_info);
        }
        elseif (
$key == "ExposureTime") {
                 
$ExposureTime explode("/"$exif_info);

            if ( 
$ExposureTime[0] == && $ExposureTime[1] == ){
                
$exif_array[$exif_match[$key]] = $ExposureTime[1]." sec(s)";
            }
            elseif ( 
$ExposureTime[0] == ) {
              
$exif_array[$exif_match[$key]] = "1/".($ExposureTime[1] * $ExposureTime[0])." sec(s)";
            }
            elseif((
$ExposureTime[0] > 1)){
              
$exif_array[$exif_match[$key]] = "1/".round($ExposureTime[1]/$ExposureTime[0])." sec(s)";
            }
            elseif ( 
$ExposureTime[1] > ) {
              
$exif_array[$exif_match[$key]] = ($ExposureTime[0]/$ExposureTime[1])." sec(s)";
            }
            elseif( 
$ExposureTime[1] == ) {
              
$exif_array[$exif_match[$key]] = ($ExposureTime[0] * $ExposureTime[1])." sec(s)";
            }
          }
        elseif (
$key == "FNumber") {
	
	
  
$aperture explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = "F/" . ($aperture[0] / $aperture[1]);
        }
        elseif (
$key == "FocalLength") {
	
	
  
$focalLen explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = ($focalLen[0] / $focalLen[1]) . "mm";
        }
        else {
          
$exif_array[$exif_match[$key]] = $exif_info;
        }
      }
    }
  }
  return 
$exif_array;
}


und ersetzt es mit diesem:

function get_exif_info($exif) {
  
$exif_match = array();
  
$exif_match['Make'] = "Make";
  
$exif_match['Model'] = "Model";
  
$exif_match['DateTimeOriginal'] = "DateTimeOriginal";
  
$exif_match['ISOSpeedRatings'] = "ISOSpeedRatings";
  
$exif_match['ExposureTime'] = "ExposureTime";
  
$exif_match['FNumber'] = "FNumber";
  
$exif_match['FocalLength'] = "FocalLength";
  
$exif_match['ExposureBiasValue'] = "ExposureBiasValue";
  
$exif_match['ApertureValue'] = "ApertureValue";
  
$exif_match['MaxApertureValue'] = "MaxApertureValue";
  
$exif_match['MeteringMode'] = "MeteringMode";
  
$exif_match['Flash'] = "Flash";
  
$exif_match['ExposureProgram'] = "ExposureProgram";
  
$exif_match['ExposureMode'] = "ExposureMode";
  
$exif_match['WhiteBalance'] = "WhiteBalance";
  
$exif_match['GPSLatitude'] = "GPSLatitude";
  
$exif_match['GPSLatitudeRef'] = "GPSLatitudeRef";
  
$exif_match['GPSLongitude'] = "GPSLongitude";
  
$exif_match['GPSLongitudeRef'] = "GPSLongitudeRef";
  
$exif_match['GPSAltitude'] = "GPSAltitude";
	
	

  
$exif_match['GPSTrack'] = "GPSTrack";

$exif_array = array();
  if (
is_array($exif)) {
    foreach (
$exif as $key => $val) {
      if (isset(
$exif_match[$key])) {
        
$exif_info $val;
        if (
$key == "DateTimeOriginal") {
          
$exif_array[$exif_match[$key]] = preg_replace("/([0-9]{4}):([0-9]{2}):([0-9]{2})/""\\3.\\2.\\1"$exif_info);
        }
        elseif (
$key == "ExposureTime") {
          
$ExposureTime explode("/"$exif_info);
          if ((float)
$ExposureTime[1] == 0) {
            
$exif_array[$exif_match[$key]] = "0 sec(s)";
          }
          elseif ((
$ExposureTime[0]/$ExposureTime[1]) >= 0.3) {
            
$exif_array[$exif_match[$key]] = round(($ExposureTime[0]/$ExposureTime[1]),1)." sec(s)";
          }
          else {
            
$exif_array[$exif_match[$key]] = "1/".round((1/($ExposureTime[0]/$ExposureTime[1])),0)." sec(s)";
          }
        }
          elseif (
$key == "FNumber") {
	
	
  
$FNumber explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = "F/" . ($FNumber[0] / $FNumber[1]);
        }
        elseif (
$key == "FocalLength") {
	
	
  
$FocalLength explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = round(($FocalLength[0] / $FocalLength[1])) . " mm";
        }
        elseif (
$key == "ExposureBiasValue") {
	
	
  
$ExposureBiasValue explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = round(($ExposureBiasValue[0] / $ExposureBiasValue[1]), 1) . " EV";
        }
        elseif (
$key == "ApertureValue") {
	
	
  
$ApertureValue explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] ="F/" round(($ApertureValue[0] / $ApertureValue[1]), 1);
        }
	
elseif (
$key == "MaxApertureValue") {
	
	
  
$MaxApertureValue explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] ="F/" round((pow(sqrt(2),$MaxApertureValue[0] / $MaxApertureValue[1])), 1);   
	
}
	
elseif (
$key == "MeteringMode") {
	
	
if(
$exif_info == 0) {$MeteringMode "Unbekannt";}
	
	
if(
$exif_info == 1) {$MeteringMode "Durchschnitt";}
 
	
	
if(
$exif_info == 2) {$MeteringMode "Mittenbetont";}  
	
	
if(
$exif_info == 3) {$MeteringMode "Spot";} 
	
	
if(
$exif_info == 4) {$MeteringMode "Multi-Spot";}
	
	
if(
$exif_info == 5) {$MeteringMode "Multi-Segment";} 
	
	
if(
$exif_info == 6) {$MeteringMode "Selektiv";} 
	
	
if(
$exif_info == 255) {$MeteringMode "Anders";} 
	
  
$exif_array[$exif_match[$key]] = ($MeteringMode);
	
}
        elseif (
$key == "Flash") {
	
	
if(
$exif_info == 0) {$Flash "Kein Blitz";} 
	
	
if(
$exif_info == 1) {$Flash "Blitz ausgelöst";} 
	
	
if(
$exif_info == 5) {$Flash "Blitz ausgelöst but strobe return light not detected";} 
	
	
if(
$exif_info == 7) {$Flash "Blitz ausgelöst and strobe return light detected";} 
	
	
if(
$exif_info == 9) {$Flash "Blitz ausgelöst, erzwungener Blitz";} 
	
	
if(
$exif_info == 13) {$Flash "Blitz ausgelöst, erzwungener Blitz, return light not detected";}
	
	
if(
$exif_info == 15) {$Flash "Blitz ausgelöst, erzwungener Blitz, return light detected";}
	
	
if(
$exif_info == 16) {$Flash "Blitz nicht ausgelöst";}
	
	
if(
$exif_info == 24) {$Flash "Flash did not fire, auto mode";}
	
	
if(
$exif_info == 25) {$Flash "Blitz ausgelöst, auto mode";}
	
	
if(
$exif_info == 29) {$Flash "Blitz ausgelöst, auto mode, return light not detected";}
	
	
if(
$exif_info == 31) {$Flash "Blitz ausgelöst, auto mode, return light detected";}
	
	
if(
$exif_info == 32) {$Flash "keine Blitzfunktion";}
	
	
if(
$exif_info == 65) {$Flash "Blitz ausgelöst, Rote Augen Reduktion";}
	
	
if(
$exif_info == 69) {$Flash "Blitz ausgelöst, Rote Augen Reduktion, return light not detected";}
	
	
if(
$exif_info == 71) {$Flash "Blitz ausgelöst, Rote Augen Reduktion, return light detected";}
	
	
if(
$exif_info == 73) {$Flash "Blitz ausgelöst, erzwungener Blitz, Rote Augen Reduktion";}
	
	
if(
$exif_info == 77) {$Flash "Blitz ausgelöst, erzwungener Blitz, Rote Augen Reduktion, return light not detected";}
	
	
if(
$exif_info == 79) {$Flash "Blitz ausgelöst, erzwungener Blitz, Rote Augen Reduktion, red-eye reduction mode, return light detected";}
	
	
if(
$exif_info == 89) {$Flash "Blitz ausgelöst, auto mode, Rote Augen Reduktion";}
	
	
if(
$exif_info == 93) {$Flash "Blitz ausgelöst, auto mode, return light not detected, Rote Augen Reduktion";}
	
	
if(
$exif_info == 95) {$Flash "Blitz ausgelöst, auto mode, return light detected, Rote Augen Reduktion";}
  
	
  
$exif_array[$exif_match[$key]] = ($Flash);
        }
	
elseif (
$key == "ExposureProgram") {
	
	
if(
$exif_info == 1) {$ExposureProgram "Manuell";} 
	
	
if(
$exif_info == 2) {$ExposureProgram "Programmautomatik";} 
	
	
if(
$exif_info == 3) {$ExposureProgram "Zeitautomatik";} 
	
	
if(
$exif_info == 4) {$ExposureProgram "Blendenautomatik";}
	
	
if(
$exif_info == 5) {$ExposureProgram "Stilleben";}
	
	
if(
$exif_info == 6) {$ExposureProgram "Sport";}
 
	
	
if(
$exif_info == 7) {$ExposureProgram "Portrait";} 
	
	
if(
$exif_info == 8) {$ExposureProgram "Landschaft";}
	
  
$exif_array[$exif_match[$key]] = ($ExposureProgram);
        }
	
elseif (
$key == "ExposureMode") {
	
	
if(
$exif_info == 0) {$ExposureMode "Automatisch";}
	
	
if(
$exif_info == 1) {$ExposureMode "Manuell";}
 
	
	
if(
$exif_info == 2) {$ExposureMode "Auto Bracket";}  
	
	
if(
$exif_info == 255) {$ExposureMode "Unbekannt";} 
	
  
$exif_array[$exif_match[$key]] = ($ExposureMode);
        }
	
elseif (
$key == "WhiteBalance") {
	
	
if(
$exif_info == 0) {$WhiteBalance "Automatisch";}
	
	
if(
$exif_info == 1) {$WhiteBalance "Manuell";}
	

	
  
$exif_array[$exif_match[$key]] = ($WhiteBalance);
	
}
	

                elseif (
$key == "GPSLatitudeRef") {
	
	
if (
$exif_info == N) {$GPSLatitudeRef "Nord";$GPSLatfaktor 1;} 
 
	
	
if (
$exif_info == S) {$GPSLatitudeRef "Süd"$GPSLatfaktor = -1;}
	
  
$exif_array[$exif_match[$key]] = ($GPSLatitudeRef);
	
  
	
	
	

        }
        elseif (
$key == "GPSLongitudeRef") {
	
	
 if (
$exif_info == E) {$GPSLongitudeRef "Ost";$GPSLongfaktor 1;}  
	
	
 if (
$exif_info == W) {$GPSLongitudeRef "West";$GPSLongfaktor = -1;}
	
  
$exif_array[$exif_match[$key]] = ($GPSLongitudeRef);
	
}
        elseif (
$key == "GPSLatitude") {
        
	
$GPSLatitude_h explode("/"$exif_info[0]);
        
	
$GPSLatitude_m explode("/"$exif_info[1]);
        
	
$GPSLatitude_s explode("/"$exif_info[2]);
        
	

        
	
$GPSLat_h $GPSLatitude_h[0] / $GPSLatitude_h[1];
        
	
$GPSLat_m $GPSLatitude_m[0] / $GPSLatitude_m[1];
        
	
$GPSLat_s $GPSLatitude_s[0] / $GPSLatitude_s[1];
        
	

        
	
$GPSLatGrad $GPSLatfaktor * ($GPSLat_h + ($GPSLat_m + ($GPSLat_s 60))/60);
        
	

        
	
$exif_array[$exif_match[$key]] =  $GPSLatitudeRef " " .$GPSLat_h "° "$GPSLat_m "' " $GPSLat_s "'' ($GPSLatGrad)";
        }
        elseif (
$key == "GPSLongitude") {
        
	
$GPSLongitude_h explode("/"$exif_info[0]);
        
	
$GPSLongitude_m explode("/"$exif_info[1]);
        
	
$GPSLongitude_s explode("/"$exif_info[2]);
        
	

        
	
$GPSLong_h $GPSLongitude_h[0] / $GPSLongitude_h[1];
        
	
$GPSLong_m $GPSLongitude_m[0] / $GPSLongitude_m[1];
        
	
$GPSLong_s $GPSLongitude_s[0] / $GPSLongitude_s[1];
        
	

        
	
$GPSLongGrad $GPSLongfaktor * ($GPSLong_h + ($GPSLong_m + ($GPSLong_s 60))/60);
        
	

        
	
$exif_array[$exif_match[$key]] =  $GPSLongitudeRef " " $GPSLong_h "° "$GPSLong_m "' " $GPSLong_s "'' ($GPSLongGrad)";
        }
        elseif (
$key == "GPSAltitude") {
   
	
	
	
  
$GPSAltitude explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = ($GPSAltitude[0] / $GPSAltitude[1]) . " Meter über NN";
        }
	
elseif (
$key == "GPSTrack") {
	
	
  
$GPSTrack explode("/"$exif_info);
          
$exif_array[$exif_match[$key]] = ($GPSTrack[0] / $GPSTrack[1]) . "°";
        }
	
else {
          
$exif_array[$exif_match[$key]] = $exif_info;
        }
      }
    }
  }
  return 
$exif_array;
}


3.) sucht in der includes/funktions.php:

if ($detailed_view && $image_info[2] == && function_exists('exif_read_data') && $exif_data = @exif_read_data($src'EXIF')) {
          
$exif_array get_exif_info($exif_data);
          
$bgcounter 0;
          foreach (
$exif_array as $key => $val) {
            
$row_bg_number = ($bgcounter++ % == 0) ? 2;
            
$site_template->register_vars(array(
              
"exif_value" => format_text($val),
              
"exif_name" => $lang['exif_'.$key],
              
"row_bg_number" => $row_bg_number
	
	
	
	
	
	
	

            ));
            
$exif_info .= $site_template->parse_template("exif_bit");
          }
        }
      }
    }


und ersetzt es mit:

if ($detailed_view && $image_info[2] == 2){
       global 
$site_db,$lang
	
$sql "SELECT image_Make, image_Model, image_DateTimeOriginal, image_ISOSpeedRatings, image_ExposureTime, image_FNumber, image_FocalLength, image_ExposureBiasValue, image_ApertureValue, image_MaxApertureValue,
                 image_MeteringMode, image_Flash, image_ExposureProgram, image_ExposureMode, image_WhiteBalance, image_GPSLatitude, image_GPSLatitudeRef, image_GPSLongitude, image_GPSLongitudeRef, image_GPSAltitude,
                 image_GPSTrack 
                 FROM "
.IMAGES_TABLE.
                 WHERE image_id = '
$image_id'";
	
$result $site_db->query($sql); 
	
$row mysql_fetch_object($result);   
	
$bgcounter 0;
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

	
 foreach (
$row as $lang['exif_'.$key] => $val) {             
	
	
if (
$val != "") {
	
	
	
	
	
	
	
	
	
	
	
	
	
$key str_replace('image_','',($lang['exif_'.$key])); 
	

	
	
	
	
	

          if ((
$key != "GPSLongitudeRef") &&  ($key != "GPSLatitudeRef")) {
          if (
$key == "GPSLongitude") {
          
	
	
$GPSLongtude substr (strrchr($val"("), 1);
          
	
	
$GPSLongtude substr ($GPSLongtude,0strlen($GPSLongtude)-1);
          
	
	
	
}
          if (
$key == "GPSLatitude") {
          
	
	
$GPSLatitude substr (strrchr($val"("), 1);
          
	
	
$GPSLatitude substr ($GPSLatitude,0strlen($GPSLatitude)-1);
          
	
	
	
}   

        
$row_bg_number = ($bgcounter++ % == 0) ? 2;
            
$site_template->register_vars(array(
               
"exif_value" => format_text($val1),
               
"exif_name" => $lang['exif_'.$key],
               
"row_bg_number" => $row_bg_number
            
));
            
$exif_info .= $site_template->parse_template("exif_bit");
           } 
// GPS
          
//end val
        
}  // end foreach 
     
// Exif aus DB
  
}
}
//################################# End Exif aus DB #################################################################


3.) in der includes/db_field_definitions.php vor ?>

//>>>>>>>>>>>>>>>>>>>>>>>>>>Exif-Info-Start<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$additional_image_fields['image_Make'] = array($lang['exif_Make'], "text"0);
$additional_image_fields['image_Model'] = array($lang['exif_Model'], "text"0);
$additional_image_fields['image_DateTimeOriginal'] = array($lang['exif_DateTimeOriginal'], "text"0);
$additional_image_fields['image_ISOSpeedRatings'] = array($lang['exif_ISOSpeedRatings'], "text"0);
$additional_image_fields['image_ExposureTime'] = array($lang['exif_ExposureTime'], "text"0);
$additional_image_fields['image_FNumber'] = array($lang['exif_FNumber'], "text"0);
$additional_image_fields['image_FocalLength'] = array($lang['exif_FocalLength'], "text"0);
$additional_image_fields['image_ExposureBiasValue'] = array($lang['exif_ExposureBiasValue'], "text"0);
$additional_image_fields['image_ApertureValue'] = array($lang['exif_ApertureValue'], "text"0);
$additional_image_fields['image_MaxApertureValue'] = array($lang['exif_MaxApertureValue'], "text"0);
$additional_image_fields['image_MeteringMode'] = array($lang['exif_MeteringMode'], "text"0);
$additional_image_fields['image_Flash'] = array($lang['exif_Flash'], "text"0);
$additional_image_fields['image_ExposureProgram'] = array($lang['exif_ExposureProgram'], "text"0);
$additional_image_fields['image_ExposureMode'] = array($lang['exif_ExposureMode'], "text"0);
$additional_image_fields['image_WhiteBalance'] = array($lang['exif_WhiteBalance'], "text"0);
$additional_image_fields['image_GPSLatitude'] = array($lang['exif_GPSLatitude'], "text"0);
$additional_image_fields['image_GPSLatitudeRef'] = array($lang['exif_GPSLatitudeRef'], "text"0);
$additional_image_fields['image_GPSLongitude'] = array($lang['exif_GPSLongitude'], "text"0);
$additional_image_fields['image_GPSLongitudeRef'] = array($lang['exif_GPSLongitudeRef'], "text"0);
$additional_image_fields['image_GPSAltitude'] = array($lang['exif_GPSAltitude'], "text"0);
$additional_image_fields['image_GPSTrack'] = array($lang['exif_GPSTrack'], "text"0);
//<<<<<<<<<<<<<<<<<<<<<<<<<<<Exif-Info-Stop<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


4.) sucht  in lang/deutsch/main.php:

// EXIF Tags
$lang['exif_make'] = "Hersteller:";
$lang['exif_model'] = "Modell:";
$lang['exif_datetime'] = "Aufnahmedatum:";
$lang['exif_isospeed'] = "ISO-Zahl:";
$lang['exif_exposure'] = "Belichtungszeit:";
$lang['exif_aperture'] = "Blende:";
$lang['exif_focallen'] = "Brennweite:";


und ersetzt es mit:

// EXIF Tags
$lang['exif_Make'] = "Hersteller:";
$lang['exif_Model'] = "Modell:";
$lang['exif_DateTimeOriginal'] = "Aufnahme,Datum und Zeit:";
$lang['exif_ISOSpeedRatings'] = "ISO Wert:";
$lang['exif_ExposureTime'] = "Belichtungszeit:";
$lang['exif_FNumber'] = "Blende:";
$lang['exif_FocalLength'] = "Brennweite (Objektiv):";
$lang['exif_ExposureBiasValue'] = "Belichtungsabweichung:";
$lang['exif_ApertureValue'] = "Blendenöffnungswert:";
$lang['exif_MaxApertureValue'] = "Maximaler Blendenöffnungswert:";
$lang['exif_MeteringMode'] = "Belichtungsmessung:";
$lang['exif_Flash'] = "Blitz:";
$lang['exif_ExposureProgram'] = "Belichtungsprogramm:";
$lang['exif_ExposureMode'] = "Belichtungsmodus:";
$lang['exif_WhiteBalance'] = "Weißabgleich:";
$lang['exif_GPSLatitudeRef'] = "GPS Breitengrad Referenz:";
$lang['exif_GPSLatitude'] = "GPS Breitengrad:";
$lang['exif_GPSLongitudeRef'] = "GPS Längengrad Referenz";
$lang['exif_GPSLongitude'] = "GPS Längengrad:";
$lang['exif_GPSAltitude'] = "GPS Höhe:";
$lang['exif_GPSTrack'] = "GPS Blickrichtung:";


5.) sucht  in der member.php (dieser schritt ist nur notwendig wenn ihr auch bei einen member upload die exif infos auslesen wollt) :

$current_time 
time();
      if (
$direct_upload) {
        
$sql "INSERT INTO ".IMAGES_TABLE."
                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments"
.$additional_field_sql.")
                VALUES
                (
$cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time$image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments".$additional_value_sql.")";
        
$result $site_db->query($sql);
        
$image_id $site_db->get_insert_id();
        if (
$result) {
          include(
ROOT_PATH.'includes/search_utils.php');
          
$search_words = array();
          foreach (
$search_match_fields as $image_column => $match_column) {
            if (isset(
$HTTP_POST_VARS[$image_column])) {
              
$search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column]);
            }
          }
          
add_searchwords($image_id$search_words);
        }
      }
      else {
        
$sql "INSERT INTO ".IMAGES_TEMP_TABLE."
                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url"
.$additional_field_sql.")
                VALUES
                (
$cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url'".$additional_value_sql.")";
        
$result $site_db->query($sql);
      }


und ersetzt es mit:

//#################################### Exif Mod Start  #################################################
if (function_exists('exif_read_data') && $exif_data = @exif_read_data($src'EXIF')) {
	
	
	
	
	

          
$exif_array get_exif_info($exif_data);
            foreach (
$exif_array as $key => $val) {
                if (
$key == "Make") {$Make $val;}
	
if (
$key == "Model") {$Model $val;}
	
if (
$key == "DateTimeOriginal") {$DateTimeOriginal $val;}
	
if (
$key == "ISOSpeedRatings") {$ISOSpeedRatings $val;}
	
if (
$key == "ExposureTime") {$ExposureTime $val;}
	
if (
$key == "FNumber") {$FNumber $val;}
	
if (
$key == "FocalLength") {$FocalLength $val;}
	
if (
$key == "ExposureBiasValue") {$ExposureBiasValue $val;}
	
if (
$key == "ApertureValue") {$ApertureValue $val;}
	
if (
$key == "MaxApertureValue") {$MaxApertureValue $val;}
	
if (
$key == "MeteringMode") {$MeteringMode $val;}
                if (
$key == "Flash") {$Flash $val;}
	
if (
$key == "ExposureProgram") {$ExposureProgram $val;}
	
if (
$key == "ExposureMode") {$ExposureMode $val;}
	
if (
$key == "WhiteBalance") {$WhiteBalance $val;}
	
if (
$key == "GPSLongitudeRef") {$GPSLongitudeRef $val;}
	
if (
$key == "GPSLatitudeRef") {$GPSLatitudeRef $val;}
	
	

	
if (
$key == "GPSLongitude") {
          
	
    
$GPSLongitude substr (strrchr($val"("), 1);
          
	
    
$GPSLongitude substr ($GPSLongitude,0strlen($GPSLonigtude)-1);
                }
                if (
$key == "GPSLatitude") {
          
	
    
$GPSLatitude substr (strrchr($val"("), 1);
          
	
    
$GPSLatitude substr ($GPSLatitude,0strlen($GPSLatitude)-1);
	
}
	
if (
$key == "GPSAltitude") {$GPSAltitude $val;}
	
if (
$key == "GPSTrack") {$GPSTrack $val;}
	
}
             }

      
$current_time time();
     if (
$direct_upload) {
    
$sql "INSERT INTO ".IMAGES_TABLE."
                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_Make, image_Model, image_DateTimeOriginal, image_ISOSpeedRatings, image_ExposureTime, image_FNumber, image_FocalLength, image_ExposureBiasValue, image_ApertureValue, image_MaxApertureValue, image_MeteringMode, image_Flash, image_ExposureProgram, image_ExposureMode, image_WhiteBalance, image_GPSLatitude, image_GPSLatitudeRef, image_GPSLongitude, image_GPSLongitudeRef, image_GPSAltitude, image_GPSTrack"
.$additional_field_sql.")
                VALUES
                (
$cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time$image_active, '$new_name', '$new_thumb_name', '$image_download_url', $image_allow_comments, '$Make', '$Model', '$DateTimeOriginal', '$ISOSpeedRatings', '$ExposureTime', '$FNumber', '$FocalLength','$ExposureBiasValue', '$ApertureValue', '$MaxApertureValue', '$MeteringMode', '$Flash', '$ExposureProgram', '$ExposureMode', '$WhiteBalance', '$GPSLatitude', '$GPSLatitudeRef', '$GPSLongitude', '$GPSLongitudeRef', '$GPSAltitude', '$GPSTrack'".$additional_value_sql.")";
        
$result $site_db->query($sql);

        
$image_id $site_db->get_insert_id();
        if (
$result) {
          include(
ROOT_PATH.'includes/search_utils.php');
          
$search_words = array();
          foreach (
$search_match_fields as $image_column => $match_column) {
            if (isset(
$HTTP_POST_VARS[$image_column])) {
              
$search_words[$image_column] = stripslashes($HTTP_POST_VARS[$image_column]);
            }
          }
          
add_searchwords($image_id$search_words);
        }
      }
      else {

        
$sql "INSERT INTO ".IMAGES_TEMP_TABLE."
                (cat_id, user_id, image_name, image_description, image_keywords, image_date, image_media_file, image_thumb_file, image_download_url, image_Make, image_Model, image_DateTimeOriginal, image_ISOSpeedRatings, image_ExposureTime, image_FNumber, image_FocalLength, image_ExposureBiasValue, image_ApertureValue, image_MaxApertureValue, image_MeteringMode, image_Flash, image_ExposureProgram, image_ExposureMode, image_WhiteBalance, image_GPSLatitude, image_GPSLatitudeRef, image_GPSLongitude, image_GPSLongitudeRef, image_GPSAltitude, image_GPSTrack"
.$additional_field_sql.")
                VALUES
                (
$cat_id, ".$user_info['user_id'].", '$image_name', '$image_description', '$image_keywords', $current_time, '$new_name', '$new_thumb_name', '$image_download_url', '$Make', '$Model', '$DateTimeOriginal', '$ISOSpeedRatings', '$ExposureTime', '$FNumber', '$FocalLength','$ExposureBiasValue', '$ApertureValue', '$MaxApertureValue', '$MeteringMode', '$Flash', '$ExposureProgram', '$ExposureMode', '$WhiteBalance', '$GPSLatitude', '$GPSLatitudeRef', '$GPSLongitude', '$GPSLongitudeRef', '$GPSAltitude', '$GPSTrack'".$additional_value_sql.")";
        
$result $site_db->query($sql);
	
}
//#################################### Exif Mod End #################################################
	



ersetzt bitte eure "admin/checkimages.php" mit der version hier im anhang.

kopiert die datei "update_exif_index.php" nach "admin/plugin".
mit dieser datei werden die vorhanden bilder der galerie nach exifdaten durchsucht und in die datenbank geschrieben.

kopiert die dateien install_exif.php und falls notwendig, die "member_install_exif.php"  in euren root ordner und führt sie aus.

wenn ihr diese suchfeld erweiterung installiert habt http://www.4homepages.de/forum/index.php?topic=21053.0
könnt ihr allle bilder der galerie nach exifdaten durchsuchen!


mfg Andi
« Last Edit: January 05, 2012, 06:35:52 PM by Rembrandt »

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #1 on: March 30, 2008, 09:01:48 PM »
Abend!

habe die englische übersetzung (soweit es mir möglich war) im ersten post hochgeladen.

mfg Andi

rinaldos

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #2 on: March 31, 2008, 06:31:08 PM »
Hi,
ich habe deinen Mod nun unter 1.7.4 installiert und es werden auch die EXIF Daten angezeigt, aber leider werden die nicht in die Datenbank eingefügt:-(

LG
Ingo

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #3 on: March 31, 2008, 06:41:34 PM »
Hi!
ja das ist ja mein großes problem was ich im ersten post geschrieben habe,
 da ich zu dämlich bin das selber zu schreiben ,das die exif automatisch mit in die datenbank aufgenommen werden.
aber vielleicht erbarmt sich doch noch einer der das kann.

wenn du im ACP bist und ein Bild dort bearbeitest, dann stehn auch die exif in der datenbank.

mfg Andi

rinaldos

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #4 on: March 31, 2008, 06:46:52 PM »
Wer liest sollte auch verstehen was da steht :-) Mein Fehler. OK, wenn ich alles von Hand eingebe ist es klar :-) Dann hoffe ich, das jemand der sich damit auskennt, auch einmal umsetzen würde :-)

LG
Ingo

P.S. Danke für die schnelle Antwort......

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #5 on: March 31, 2008, 07:09:43 PM »
@ Rembrandt

... um einen Wert sollte man die Anzeige der GPS-Exif-Info m.E. noch erweitern ...
... Wert : "GPSTrack" ...
... dieser Wert zeigt die Blickrichtung vom Aufnahmestandort zum Fotomotiv im Uhrzeigersinn in Grad an ...
... also von Nord= 0° , Ost= 90° , Süd = 180° über West = 270° bis dann 360° ...
... in Google Maps lässt sich dieser Wert noch nicht darstellen, in Google Earth jedoch schon ...
... d.h. der Globus wird in Blickrichtung nach oben ausgerichtet ...

die erforderlichen Erweiterungen für die Exif-Info habe ich in der exif.php 
( http://www.4homepages.de/forum/index.php?topic=3274.msg84606#msg84606 ) wie folgt vorgenommen :

1. ... in define('EXIF_FILTER', "
Code: [Select]
GPSTrack:

2. ... in function exif_parse_value($name, $val) {
Code: [Select]
case "GPSTrack":
$val = exif_get_str_val($val) ." °";
break;

2. ... in function exif_parse_name($name, $val) {
Code: [Select]
case "GPSTrack":
$name = "GPS-Blickrichtung";
break;

Eine Anpassung für die Auslesung der Exif-Info über die functions.php (siehe oben) müsste dann dementsprechend erfolgen ...


Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!
Re: [MOD] Exif V.1.7.6
« Reply #6 on: March 31, 2008, 07:25:35 PM »
schön wäre doch (sonst wir dies ein endlos lager Thread), wenn die Erweiterung der tabelle in der DB eine .txt oder eine SQL-Datei wäre, mit der entsprechenden Anleitung, noch besser wäre, wenn es wie bei den Slide-Show-MOD´s von Kurtw, gelich eine install.php vorhanden wäre, oder??

(ich brauchs nicht, bin kein Fotograf, aber das wird sicher noch 100x gefragt) :wink:

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #7 on: March 31, 2008, 07:31:26 PM »
Hi!
steht doch eh oben?
eintrag in die Datenbank.

mfg Andi

Offline honda2000

  • 4images Guru
  • *******
  • Posts: 3.263
    • View Profile
    • Wir machen Internet!
Re: [MOD] Exif V.1.7.6
« Reply #8 on: March 31, 2008, 07:41:11 PM »
ja, ich weis was man eintragen muss, und wo
nur
wenn jemand von MySQL keine Ahung hat, der nimmt das ich die Zwischenablagen und versucht es so einzufügen, das geht aber dann nicht

es war ja nur ein Vorschlag, ein Hinweis, KEIN MUSS)

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #9 on: March 31, 2008, 09:12:51 PM »
sonst wir dies ein endlos lager Thread
...  :? ...
... mit solchen Kommentaren wohl ...
... Rembrandt hat seinen ersten Post doch bestens aufgestellt und aktualisiert ihn auch ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #10 on: March 31, 2008, 09:41:09 PM »
...... um einen Wert sollte man die Anzeige der GPS-Exif-Info m.E. noch erweitern ...
... Wert : "GPSTrack" ...
...

ist erledigt und oben aktuallisiert.  :D

mfg Andi

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #11 on: March 31, 2008, 10:08:18 PM »
hier die automatischen db einträge.

thx 2 all
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline nobby

  • 4images Guru
  • *******
  • Posts: 2.873
    • View Profile
Re: [MOD] Exif V.1.7.6
« Reply #12 on: March 31, 2008, 10:27:06 PM »
Hallo Rembrandt,

habe Dein MOD Eingebaut, läuft Hervorragend, klasse Arbeit.

Besten Dank !

nobby

Rembrandt

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #13 on: April 01, 2008, 08:26:05 PM »
Abend!

soda, habe es nun doch geschaft die exif informationen in die datenbank zu bekommen.

es gab eine kleine änderung in der funktions.php, betroffen sind die funktionen GPSLatidudeRef und GPSLongitudeRef, Sorry.
diese änderung war notwendig da ich sonst diese werte nicht in die datenbank bekommen hätte.

desweitern wird die modifizierte checkimages.php aus dem forum benötigt die ich im ersten post hochgeladen habe, die ist zuständig dafür damit die daten in die datenbank geschrieben werden.

@Nicky, DANKE für die Datei!

mfg Andi



rinaldos

  • Guest
Re: [MOD] Exif V.1.7.6
« Reply #14 on: April 02, 2008, 08:52:51 AM »
Hi.
Ich habe nun mal deinen MOD mit der neuen Checkimages ausprobiert. Nur leider funktioniert da die Option BIG Folder nicht.
(Sie funktioniert nur nicht wenn ich in den Default Settings das einstelle:


//--------| Default Settings |-------------

$quality_default = ($config['auto_image_quality']) ? $config['auto_image_quality'] : 85; //image quality
$quality_thumbs_default = $config['auto_thumbnail_quality']; //thumbnail quality
$dimension_default = $config['max_image_width']; //image dimension
$dimension_thumbs_default = $config['auto_thumbnail_dimension']; //thumbnail demension
$max_dimension_default = 600; //displayed in preview image dimension (not image resizing)
$num_newimages_default = 30; //images per circle
$big_folder_default = "big"; //name of the "big" folder
if (!$mode) {
  $big_default = 1; //0 or 1 save original image
  $auto_iptc_default = 1; //0 or 1 auto insert IPTC
  $date_iptc_default = 1; //0 or 1 auto insert date from IPTC
  $detailed_default = 1; //0 or 1 detailed view
  $auto_resize_default = 1; //0 or 1 resize images
  $auto_thumbs_default = 1; //0 or 1 create thumbs
}

//----------| End Settings |---------------

)

Und wenn ich nur die GPS Erweiterungen in meine Checkimages.php aufnehme, bekomme ich folgende Fehlermeldung:
Code: [Select]
DB Error: Bad SQL Query: INSERT INTO 4images_images (cat_id, user_id, image_name, image_description, image_keywords, image_date,
 image_active, image_media_file, image_thumb_file, image_download_url, image_allow_comments, image_Make, image_Model,
image_DateTimeOriginal, image_ISOSpeedRatings, image_ExposureTime, image_FNumber, image_FocalLength, image_ExposureBiasValue,
image_ApertureValue, image_MaxApertureValue, image_MeteringMode, image_Flash, image_ExposureProgram, image_ExposureMode,
image_WhiteBalance, price, image_gmap_latitude, image_gmap_longitude, image_gmap_zoom, image_gmap_type, image_gmap_show,
image_Make, image_Model, image_DateTimeOriginal, image_ISOSpeedRatings, image_ExposureTime, image_FNumber, image_FocalLength,
image_ExposureBiasValue, image_ApertureValue, image_MaxApertureValue, image_MeteringMode, image_Flash, image_ExposureProgram,
image_ExposureMode, image_WhiteBalance, image_ColorSpace, image_GPSLatitude, image_GPSLatitudeRef, image_GPSLongitude,
image_GPSLongitudeRef, image_GPSAltitude) VALUES (123, 14, 'Antje', 'Antje, das Fotomodel', 'Heels Dessous Stiletto Portrait Lack Leder',
UNIX_TIMESTAMP('2008-04-02 07:47:45'), 1, 'IMG_5191.jpg', 'IMG_5191.jpg', '', 1, 'Canon', 'Canon EOS 350D DIGITAL', '26.02.2008 10:26:41',
'400', '1/60 Sekunde', 'F/4', '28 mm','0 EV', 'F/4', 'F/4', 'Multi-Segment', 'Blitz ausgel&ouml;st, erzwungener Blitz, Rote Augen Reduktion',
'Programmautomatik', 'Automatisch', 'Manuell', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '')

Column 'image_WhiteBalance' specified twice

Vielleicht hat ja jemand eine Idee :-)

LG
Ingo
« Last Edit: April 02, 2008, 09:09:09 AM by rinaldos »