diff -r 36dd990c0c25 -r ecb96b051d08 plugins/gallery/upload.php --- a/plugins/gallery/upload.php Thu Nov 29 22:47:20 2007 -0500 +++ b/plugins/gallery/upload.php Wed Dec 05 16:53:26 2007 -0500 @@ -833,10 +833,13 @@ // Create thumbnail image $thumb_filename = ENANO_ROOT . '/cache/' . $stored_name . '-thumb.jpg'; - if ( !unlink($thumb_filename) ) + if ( file_exists($thumb_filename) ) { - $errors[] = "Could not delete $thumb_filename"; - break 2; + if ( !unlink($thumb_filename) ) + { + $errors[] = "Could not delete $thumb_filename"; + break 2; + } } if ( !scale_image($store, $thumb_filename, 80, 80) ) @@ -847,10 +850,13 @@ // Create preview image $preview_filename = ENANO_ROOT . '/cache/' . $stored_name . '-preview.jpg'; - if ( !unlink($preview_filename) ) + if ( file_exists($preview_filename) ) { - $errors[] = "Could not delete $preview_filename"; - break 2; + if ( !unlink($preview_filename) ) + { + $errors[] = "Could not delete $preview_filename"; + break 2; + } } if ( !scale_image($store, $preview_filename, 640, 640) )