summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);