]> git.decadent.org.uk Git - memories.git/blobdiff - Memories/Photo.pm
A bit of defense.
[memories.git] / 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);