fix problem third problem reported at https://www.zarb.org/pipermail/booh-discuss...
authorGuillaume Cottenceau <gcottenc@gmail.com>
Fri, 13 Jun 2008 22:08:22 +0000 (00:08 +0200)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Fri, 13 Jun 2008 22:08:22 +0000 (00:08 +0200)
bin/booh-backend

index 596b019..1e03a35 100755 (executable)
@@ -1056,8 +1056,8 @@ def walk_source_dir
             
             msg 3, _("\tgenerating HTML pages...")
             #- fixup max per page
-            if $N_per_page && $N_per_row
-                $N_per_page = $N_per_page.to_i / $N_per_row.to_i * $N_per_row.to_i
+            if $N_per_page
+                $N_per_page = $N_per_page.to_i / ($N_per_row || $default_N).to_i ** 2
             end
 
             #- generate thumbnails*.html (page with thumbnails)
@@ -1085,7 +1085,7 @@ def walk_source_dir
                 for file in entries
                     type = images.include?(file) ? 'image' : videos.include?(file) ? 'video' : nil
                     if type
-                        homogeinize_width = 100 / $N_per_row.to_i
+                        homogeinize_width = 100 / ($N_per_row || $default_N).to_i
                         if type == 'image' && elem = optfilename[utf8(file)]
                             if pano = pano_amount(elem)
                                 html_elem = run_iterations(iterations, pano)