]> git.decadent.org.uk Git - memories.git/commitdiff
A bit of defense.
authorSimon Cozens <simon@simon-cozens.org>
Fri, 16 Feb 2007 22:39:25 +0000 (22:39 +0000)
committerSimon Cozens <simon@simon-cozens.org>
Fri, 16 Feb 2007 22:39:25 +0000 (22:39 +0000)
git-svn-id: http://svn.simon-cozens.org/memories/trunk@34 041978f6-d955-411f-a9d7-1d8545c9c3c7

Memories/Photo.pm

index 8286480aa1f952191c75216b33664978e48f3379..e2175c5ca80737387fae96525b7f4e559369a8b5 100644 (file)
@@ -68,7 +68,9 @@ sub upload_jpeg {
         rating => 0,
         rated => 0,
     });
-    copy($filename, $photo->path("file"));
+    if (!copy($filename, $photo->path("file"))) {
+        $photo->delete(); die "Couldn't copy photo: $!";
+    }
     my ($x, $y) = dim(image_info($photo->path));
     $photo->x($x); $photo->y($y);