Hallo Leute,
ich mir Extension goof_fotoboek installiert und soweit läuft auch alles. Die Funktionen zum EXIF-Daten auslesen bei den Bildern find ich sehr. Nur möchte ich nicht alle möglichen Daten eines Bildes erhalten, sondern nur bestimmte, z.B. Copyright, Beschreibung, Autor, etc.
In der Datei class.tx_gooffotoboek_pi1.php habe ich (denke ich mal) die Funktionen gefunden, die dafür verantwortlich sind.
/**
* Get EXIF information if possible
* method priority is metacam, jhead and PHP internal EXIF support
*
* @param string $file: path to the original image
* @return string Exif information in html format
*/
function getExif($file) {
$exif = $this->getExifArray($file);
if ( count( $exif ) == 0 ) {
$ret .= 'NO EXIF Information metacam or jhead not configured and no exif support in this php version<br />';
}
else {
$exiftable = '';
$exif_fields = '/Image Capture Date|Make$|Model|ISO Speed Rating|Image Description|'
.'Focal Length|Flash$|Aperture|Exposure Time|Shutter Speed Value|'
.'Date\/?Time$|ISO equiv|Flash used/i';
foreach ($exif as $key => $value) {
if (preg_match($exif_fields , $key) or $this->conf['show_exif_all'] == 1) {
if ($value) {
$exiftable .= $this->fastWrap($key,$this->conf['exif_tag_wrap'])
.$this->fastWrap($value,$this->conf['exif_value_wrap']);
}
}
}
if ($exiftable != '') {
$ret .=$this->fastWrap($exiftable,$this->conf['exif_all_wrap']);
}
}
return $ret;
}
/**
* Get EXIF information if possible
* method priority is metacam, jhead and PHP internal EXIF support
*
* @param string $file: path to the original image
* @return string Exif information in html format
*/
function getExifnot($file) {
$ret = '';
// for older php version an external program is needed
// I chose metacam and jhead to get the
if (@file_exists($this->conf['exif_metacam'])) {
exec('"'.$this->conf['exif_metacam'].'" "'.$file.'"' , $txt);
if (is_array($txt)) {
foreach ($txt as $row) {
preg_match('/^([^:]+):(.*)$/', $row, $match);
$exif[ $match[1] ] = $match[2];
}
}
} elseif (@file_exists($this->conf['exif_jhead'])) {
exec('"'.$this->conf['exif_jhead'].'" "'.$file.'"' , $txt);
if (is_array($txt)) {
foreach ($txt as $row) {
preg_match('/^([^:]+):(.*)$/', $row, $match);
$exif[ $match[1] ] = $match[2];
}
}
} elseif (@function_exists(exif_read_data)) {
$txt = exif_read_data($file, 'EXIF', false);
if (is_array($txt)) {
foreach ($txt as $name => $val) {
$val = preg_replace('/[^\w\d\s=\/:]/' , '', $val);
$exif[$name] = $val;
}
}
} else {
$ret .= 'NO EXIF Information metacam or jhead not configured and no exif support in this php version<br />';
}
if (is_array($exif)) {
$exiftable = '';
// time patch by Sven
$exif_fields = '/Image Capture Date|Make$|Model|ISO Speed Rating|Image Description|' .'Focal Length|Flash$|Aperture|Exposure Time|Shutter Speed Value|' .'Date\/?Time$|ISO equiv|Flash used/i';
foreach ($exif as $key => $value) {
if (preg_match($exif_fields , $key) or $this->conf['show_exif_all'] == 1) {
if ($value) {
$exiftable .= $this->fastWrap($key, $this->conf['exif_tag_wrap'])
.$this->fastWrap($value, $this->conf['exif_value_wrap']);
}
}
}
if ($exiftable != '') {
$ret .= $this->fastWrap($exiftable, $this->conf['exif_all_wrap']);
}
}
return $ret;
}
Nur hab ich leider keine Ahnung, wie ich die Funktionen nun anpassen muss, um nicht alle EXIF-Daten zu erhalten.
Kann da jemand weiterhelfen?
mfg
Christian