Získanie informácií o fotografii (EXIF)
function parse( $exif ) {
foreach( $exif as $key => $section ) {
if( is_array( $section ) ) {
foreach( $section as $name => $val ) {
echo $key.' -> '.$name.': '.$val.'<br />';
}
}
}
}
function parsetable( $exif ) {
if( is_array( $exif ) ) {
$out = '<table>';
foreach( $exif as $key => $section ) {
$out .= '<tr><th align="left" colspan="2">'.$key.'</th></tr>';
if( is_array( $section ) ) {
foreach( $section as $name => $val ) {
$out .= '<tr><td>'.$name.'</td><td>'.$val.'</td></tr>';
}
}
}
$out .= '</table>';
}
return $out;
}
$exif = exif_read_data( 'fileadmin/sitename
/user_upload/images/loga.jpg', 0, true );
echo '<p>'.parse( $exif ).'</p>';
$exif = exif_read_data( 'fileadmin/sitename
/user_upload/images/000018.jpg', 0, true );
echo '<p>'.parse( $exif ).'</p>';
$exif = @exif_read_data( 'fileadmin/sitename/user_upload/images/p5220019.jpg', 0, true );
echo '<p>'.parsetable( $exif ).'</p>';
Príklad použitia triedy EXIF (na stiahnutie dole):
// Get EXIF data
$this->cexif = new classExif();
$this->cexif->init( $this->path.$filename );
$this->exifdata = $this->cexif->parseexif( $this->cexif->setup );
| Class EXIF, 3.6 (kB) | ||
Generátor typoscriptu
Vytvára typoscript pre bežné použitie. Generátor je jednoduchý na obsluhu, stačí vyplniť zopár položiek formulára.