2003
Årsfest 2003
Anne Lenes bilder
$file ) {
$nr = $nr + 1;
$strings = explode('.', $file );
$file_type = strtolower( end( $strings ) );
// Skip files that are not images
if ($file == "."){continue;}
if ($file == ".."){continue;}
if (!(in_array( $file_type, $file_display))) {continue;}
$image = $dir1.'/'.$file;
//echo "Image: ", $image, "
\n";
//http://m.a.gg/manual/en/function.exif-read-data.php
$exif = exif_read_data($image, 0, true);
$camMake=NULL;
$camModel=NULL;
$camExposure=NULL;
$camAperture=NULL;
$dateTimeOriginal=NULL;
$camIso=NULL;
$title=NULL;
$comment=NULL;
foreach ($exif as $key => $section) {
foreach ($section as $name => $val) {
//echo "$key.$name: $val
\n";
if ($key=="IFD0" && $name=="Make") {$camMake=$val;}
if ($key=="IFD0" && $name=="Model") {$camModel=$val;}
if ($key=="EXIF" && $name=="ExposureTime") {$camExposure=$val;}
if ($key=="EXIF" && $name=="Flash") {$camFlash=$val;}
if ($key=="COMPUTED" && $name=="ApertureFNumber") {$camAperture=$val;}
if ($key=="EXIF" && $name=="DateTimeOriginal") {$dateTimeOriginal=$val;}
if ($key=="EXIF" && $name=="ISOSpeedRatings") {$camIso=$val;}
if ($key=="IFD0" && $name=="Title") {$title=$val;}
if ($key=="IFD0" && $name=="Comments") {$comment=$val;}
}
}
$table[$nr] = array ($file, $camMake, $camModel, $camExposure, $camFlash, $camAperture, $dateTimeOriginal, $camIso, $title, $comment);
}
echo count($table), " bilder", '
'."\n";
$keys = array_column($table, '6');
array_multisort($keys, SORT_ASC, $table);
foreach ($table as $key => $row) {
echo '
'."\n";
// echo 'table row 0=', $row[0], '
', "\n";
// echo 'table row 1=', $row[1], '
', "\n";
// echo 'table row 2=', $row[2], '
', "\n";
// echo 'table row 3=', $row[3], '
', "\n";
// echo 'table row 4=', $row[4], '
', "\n";
// echo 'table row 5=', $row[5], '
', "\n";
// echo 'table row 6=', $row[6], '
', "\n";
// echo 'table row 7=', $row[7], '
', "\n";
// echo 'table row 8=', $row[8], '
', "\n";
// echo 'table row 9=', $row[9], '
', "\n";
$file = $row[0];
$camMake = $row[1];
$camModel = $row[2];
$camExposure = $row[3];
$camFlash = $row[4];
$camAperture = $row[5];
$dateTimeOriginal = $row[6];
$camIso = $row[7];
$title = utf8_encode($row[8]);
$comment = $row[9];
//echo '
'."\n";
echo ''."\n";
$presDate = substr($dateTimeOriginal, 0, 16);
if (isset($camIso)) {$presISO = 'ISO-'.$camIso;} else {$presISO=NULL;}
if (isset($camExposure)) {$presExp = $camExposure.'s';} else {$presExp=NULL;}
// Flash codes
$bin = decbin($camFlash);
$bit1 = substr($bin, -1, 1);
$bit34 = substr($bin, -5, 2);
if ($bit1=='1'){$presFlash1='F';} else {$presFlash1='nF';}
if ($bit34=='01'){$presFlash2='comp';}
elseif ($bit34=='10'){$presFlash2='comp';}
elseif ($bit34=='11'){$presFlash2='auto';}
else {$presFlash2=' ';}
if (isset($title)){echo $title, '
'."\n";}
if (isset($comment)){echo $comment, '
'."\n";}
// echo "[";
// echo $file, " ";
// echo $presDate, "\n";
// if ($camMake!=='Canon'){echo $camMake, " ";}
// echo $camModel, " ";
// if (isset($presISO)){echo $presISO, " ";}
// if (isset($presExp)){echo $presExp, " ";}
// echo $camAperture, " ";
// //echo $bin, '-', $bit1, '-', $bit34, " ";
// echo $presFlash1, $presFlash2, ']
'."\n";
echo ''."\n";
}
//Shift Date/time
//exiftool "-AllDates+=1:12:28 14:54:32" -verbose *.jpg
//to adjust all JPG image dates by adding 1 year, 12 month, 28 days, 14 hours, 54 minutes, 32 seconds
//Toralf og Tor
//P:\Source\exiftool-11.98\exiftool "-AllDates+=0:01:27 20:22:00" -verbose H:\temp\saeby_ingunn\small\*.jpg
//P:\Source\exiftool-11.98\exiftool "-AllDates+=0:01:27 20:22:00" -verbose H:\temp\saeby_ingunn\large\*.jpg
//P:\Source\exiftool-11.98\exiftool "-AllDates+=0:00:00 00:50:00" -verbose H:\temp\saeby_tor\small\*.JPG
//P:\Source\exiftool-11.98\exiftool "-AllDates+=0:00:00 00:50:00" -verbose H:\temp\saeby_tor\large\*.JPG
//P:\Source\exiftool-11.98\exiftool "-AllDates-=0:00:06 01:00:00" -verbose H:\temp\saeby_ingunn\small\*.jpg
//P:\Source\exiftool-11.98\exiftool "-AllDates+=0:00:00 03:32:00" -verbose R:\asterix\var\www\htdocs\porsgrunn-janitsjarorkester.org\2007\saeby_bilder\large\Musikfest(08).jpg*.jpg
// Rename to upper case
//Get-ChildItem -Path "R:\asterix\var\www\htdocs\porsgrunn-janitsjarorkester.org\2005\rjukan\small" -Recurse | Where{ $_.Name -cne $_.Name.ToUpper() } | ForEach-Object { $tn="$($_.Name)-temp"; $tfn="$($_.FullName)-temp"; $nn=$_.Name.ToUpper(); Rename-Item -Path $_.FullName -NewName $tn; Rename-Item -Path $tfn -NewName $nn -Force; Write-Host "New Name: $($nn)";}
?>