From 267b9c30df4100aa0f4d8ea189a3f3e78334cde8 Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 18 Apr 2009 17:35:23 +0000 Subject: Fixed the initial file order to be alphabetical when creating a new album. --- utils/modules/gallery.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'utils') diff --git a/utils/modules/gallery.php b/utils/modules/gallery.php index b3f410d..4820a04 100644 --- a/utils/modules/gallery.php +++ b/utils/modules/gallery.php @@ -147,9 +147,16 @@ function unpackImages($zipfile, $album) // // http://dk.php.net/manual/en/book.exif.php if(!file_exists($album->getPath())) mkdir($album->getPath()); + $imagefiles = array(); $d = opendir($folder); while(false !== ($f = readdir($d))) { if(!isJpeg($f)) continue; + array_push($imagefiles, $f); + } + + sort($imagefiles); + + foreach($imagefiles as $f) { $tags = exif_read_data($folder . "/" . $f, "ANY_TAG"); rename($folder . "/" . $f, $album->getPath() . "/" . $f); $photo = new Photo($album->getPath(), $album->getNextID(), $tags['ImageDescription'], $f); -- cgit v1.2.3