package Memories::Photo;
+use Apache2::Upload;
use File::Basename;
use File::Copy;
use Archive::Any;
rated => 0,
});
if (!copy($filename, $photo->path("file"))) {
- $photo->delete(); die "Couldn't copy photo: $!";
+ warn "Couldn't copy photo to ".$photo->path("file").": $!";
+ $photo->delete(); die;
}
my ($x, $y) = dim(image_info($photo->path));
$photo->x($x); $photo->y($y);
$photo->make_thumb;
my $tags = $r->{params}{tags}.join " ", map { qq{"$_"} } $photo->tags_exif;
$photo->add_tags($tags);
+warn "D";
$photo->add_to_imageseek_library;
Memories->zap_cache();
+warn "E";
# Add system tags here
my $tag = "date:".$photo->shot->ymd;
if ($scale) { $path .= "$scale/" }
# Make dir if it doesn't exist, save trouble later
use File::Path;
- if ($is_url ne "url") {mkpath($path);}
+ if ($is_url ne "url" and ! -d $path) {mkpath($path) or die "Couldn't make path $path: $!";}
if ($scale or $is_url ne "url") {
$path .= $self->id.".jpg";
} else {