From: Oren T. <ore...@su...> - 2001-02-08 01:27:51
|
darn it - there's a bug. It doesn't display "next image" and "previous" image sorted by date right. chanage index.cgi:376 sort='.$sort.' to sort=".$sort." and it should work right. ------------------------------------------- I vote for EXIF data. Much better idea. If you replace the foreach loop that currently sorts in the 3 or 4 locations around the file with this one: foreach my $fileName (@itemsToDisplay) { my($camdate,$camtime); my($picinfo) = image_info($fileName); if ((defined($picinfo->{'DateTimeOriginal'})) && ($picinfo->{'DateTimeOriginal'} ne '0000:00:00 00:00:00')) { $camdate = $picinfo->{'DateTimeOriginal'}; my ($date,$time) = split / /, $camdate; my ($year,$month,$day) = split /:/, $date; my ($hour,$min,$sec) = split /:/, $time; $month--; $year -= 1900; $camtime = timelocal($sec,$min,$hour,$day,$month,$year); $mtime{$fileName} = $camtime; } else { my $modTime = (stat $fileName)[9]; $mtime{$fileName} = $modTime; } } it'll sort by exif date if it exists, else by mtime. I think I should have just made this a function that each place can call... Oren |