*** empty log message ***
authorgc <gc>
Mon, 25 Feb 2008 23:00:17 +0000 (23:00 +0000)
committergc <gc>
Mon, 25 Feb 2008 23:00:17 +0000 (23:00 +0000)
bin/booh

index 22a050915e016f137eb611cb22e74b02d75ad505..52a15b87284f7ad565716e3e80344c9e4dbd6959 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -1139,7 +1139,11 @@ def add_thumbnail(autotable, filename, type, thumbnail_img, caption)
         #- remove out of sync images
         dest_img_base = build_full_dest_filename(filename).sub(/\.[^\.]+$/, '')
         for sizeobj in $images_size
-            File.delete("#{dest_img_base}-#{sizeobj['fullscreen']}.jpg", "#{dest_img_base}-#{sizeobj['thumbnails']}.jpg")
+            for file in "#{dest_img_base}-#{sizeobj['fullscreen']}.jpg", "#{dest_img_base}-#{sizeobj['thumbnails']}.jpg"
+                if File.exists?(file)
+                    File.delete(file)
+                end
+            end
         end
 
     }
@@ -2374,13 +2378,17 @@ def change_dir
         }
 
         refresh = proc {
-            File.delete(thumbnail_file)
+            if File.exists?(thumbnail_file)
+                File.delete(thumbnail_file)
+            end
             my_gen_real_thumbnail.call
         }
 
         rotate_and_cleanup = proc { |angle|
             rotate(angle, thumbnail_file, img, xmldir, "#{infotype}-", $default_albums_thumbnails[:x], $default_albums_thumbnails[:y])
-            File.delete(thumbnail_file)
+            if File.exists?(thumbnail_file)
+                File.delete(thumbnail_file)
+            end
         }
 
         move = proc { |direction|
@@ -2473,7 +2481,9 @@ def change_dir
                     change_whitebalance(xmldir, "#{infotype}-", val)
                     recalc_whitebalance(val, captionfile, thumbnail_file, img, xmldir, "#{infotype}-",
                                         $default_albums_thumbnails[:x], $default_albums_thumbnails[:y], infotype)
-                    File.delete(thumbnail_file)
+                    if File.exists?(thumbnail_file)
+                        File.delete(thumbnail_file)
+                    end
                 }
                 perform_change_whitebalance_and_cleanup.call(values[:new])
                 
@@ -2496,7 +2506,9 @@ def change_dir
                     change_gammacorrect(xmldir, "#{infotype}-", val)
                     recalc_gammacorrect(val, captionfile, thumbnail_file, img, xmldir, "#{infotype}-",
                                         $default_albums_thumbnails[:x], $default_albums_thumbnails[:y], infotype)
-                    File.delete(thumbnail_file)
+                    if File.exists?(thumbnail_file)
+                        File.delete(thumbnail_file)
+                    end
                 }
                 perform_change_gammacorrect_and_cleanup.call(values[:new])