summaryrefslogtreecommitdiff
path: root/utils/modules/gallery.php
diff options
context:
space:
mode:
authordeva <deva>2009-04-18 17:35:23 +0000
committerdeva <deva>2009-04-18 17:35:23 +0000
commit267b9c30df4100aa0f4d8ea189a3f3e78334cde8 (patch)
tree7e2e0eec8cadf2c4fe04477d21814b3b375fb46a /utils/modules/gallery.php
parenteb13d28209745f6d59586d3f56f9e8d73712948b (diff)
Fixed the initial file order to be alphabetical when creating a new album.
Diffstat (limited to 'utils/modules/gallery.php')
-rw-r--r--utils/modules/gallery.php7
1 files changed, 7 insertions, 0 deletions
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);