add some missing cleanups
[booh] / bin / booh
index 3e509b7f8d9f0307ee2a9017a755b945e6389d30..da0028e05d20ce6380d9bb359fc96efab0695757 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -1125,8 +1125,8 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
     }
  
     rotate_and_cleanup = proc { |angle|
-        rotate(angle, thumbnail_img, img, $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y])
         cleanup_all_thumbnails.call
+        rotate(angle, thumbnail_img, img, $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y])
     }
 
     move = proc { |direction|
@@ -1156,11 +1156,11 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     color_swap_and_cleanup = proc {
         perform_color_swap_and_cleanup = proc {
+            cleanup_all_thumbnails.call
             color_swap($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }
 
-        cleanup_all_thumbnails.call
         perform_color_swap_and_cleanup.call
 
         save_undo(_("color swap"),
@@ -1180,6 +1180,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     change_frame_offset_and_cleanup_real = proc { |values|
         perform_change_frame_offset_and_cleanup = proc { |val|
+            cleanup_all_thumbnails.call
             change_frame_offset($xmldir.elements["*[@filename='#{filename}']"], '', val)
             my_gen_real_thumbnail.call
         }
@@ -1208,6 +1209,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     change_pano_amount_and_cleanup_real = proc { |values|
         perform_change_pano_amount_and_cleanup = proc { |val|
+            cleanup_all_thumbnails.call
             change_pano_amount($xmldir.elements["*[@filename='#{filename}']"], '', val)
         }
         perform_change_pano_amount_and_cleanup.call(values[:new])
@@ -1235,10 +1237,10 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     whitebalance_and_cleanup_real = proc { |values|
         perform_change_whitebalance_and_cleanup = proc { |val|
+            cleanup_all_thumbnails.call
             change_whitebalance($xmldir.elements["*[@filename='#{filename}']"], '', val)
             recalc_whitebalance(val, fullpath, thumbnail_img, img,
                                 $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
-            cleanup_all_thumbnails.call
         }
         perform_change_whitebalance_and_cleanup.call(values[:new])
 
@@ -1266,10 +1268,10 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
      gammacorrect_and_cleanup_real = proc { |values|
          perform_change_gammacorrect_and_cleanup = Proc.new { |val|
+             cleanup_all_thumbnails.call
              change_gammacorrect($xmldir.elements["*[@filename='#{filename}']"], '', val)
              recalc_gammacorrect(val, fullpath, thumbnail_img, img,
                                  $xmldir.elements["*[@filename='#{filename}']"], '', $default_thumbnails[:x], $default_thumbnails[:y], '')
-             cleanup_all_thumbnails.call
          }
          perform_change_gammacorrect_and_cleanup.call(values[:new])
  
@@ -1297,6 +1299,7 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
 
     enhance_and_cleanup = proc {
         perform_enhance_and_cleanup = proc {
+            cleanup_all_thumbnails.call
             enhance($xmldir.elements["*[@filename='#{filename}']"], '')
             my_gen_real_thumbnail.call
         }