Cleanup
authorMichael Ang <mang@archive.org>
Sat, 31 Jul 2010 00:22:52 +0000 (00:22 +0000)
committerMichael Ang <mang@archive.org>
Sat, 31 Jul 2010 00:22:52 +0000 (00:22 +0000)
BookReaderIA/datanode/BookReaderMeta.inc.php

index 179c7cb..c0afca3 100644 (file)
@@ -263,9 +263,7 @@ class BookReaderMeta {
     
     // Returns { 'imageFormat' => , 'archiveFormat' => '} given a sub-item prefix and loaded xml data
     function findImageStack($subPrefix, $filesData) {
-    
-        static $cbPrefix = NULL;
-    
+        
         // The order of the image formats determines which will be returned first
         $imageFormats = array('JP2' => 'jp2', 'TIFF' => 'tif', 'JPEG' => 'jpg');
         $imageFormatOrder = array_values($imageFormats);
@@ -304,17 +302,13 @@ class BookReaderMeta {
             }
         }
 
-        /*
-        print("<pre>");
-        print("found subPrefix $subPrefix\n");
-        print_r($imageStacks);
-        */
+        // print("<pre>");
+        // print("found subPrefix $subPrefix\n");
+        // print_r($imageStacks);
+        // die(0);
         
         function subPrefixSort($imageStackA, $imageStackB) {
-            if ($imageStackA['subPrefix'] == $imageStackB['subPrefix']) {
-                return 0;
-            }
-            return ($imageStackA['subPrefix'] < $imageStackB['subPrefix']) ? -1 : 1;
+            return strcmp($imageStackA['subPrefix'], $imageStackB['subPrefix']);
         }
         if (! $subPrefix) {
             usort($imageStacks, 'subPrefixSort');