From 33a3af1b640ffb40912f0a9b4de60ca460587712 Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Fri, 16 Feb 2007 22:39:25 +0000 Subject: [PATCH] A bit of defense. git-svn-id: http://svn.simon-cozens.org/memories/trunk@34 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- Memories/Photo.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Memories/Photo.pm b/Memories/Photo.pm index 8286480..e2175c5 100644 --- a/Memories/Photo.pm +++ b/Memories/Photo.pm @@ -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); -- 2.39.5