X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=Memories%2FPhoto.pm;h=e2175c5ca80737387fae96525b7f4e559369a8b5;hb=33a3af1b640ffb40912f0a9b4de60ca460587712;hp=8286480aa1f952191c75216b33664978e48f3379;hpb=b90a2bd4a7a31ea891d9c9692c5d96cb52b2e3b3;p=memories.git 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);