use File::Path qw(rmtree);
use File::Find;
use File::MMagic;
+use Image::Size qw(imgsize);
use strict;
use Carp qw(cluck confess);
use base qw(Memories::DBI Maypole::Model::CDBI::Plain);
my ($self, $r, $filename, $offered_name) = @_;
my $jpg = tmpnam().".jpg";
system("dcraw -c $filename | convert - $jpg");
- my $photo = $self->upload_jpeg($r, $jpg, $offered_name);
$filename =~ /\.(.*)$/;
my $format = $1;
- $photo->format($format);
# Put the file in place
+ $photo->format($format);
copy($filename,
Memories->config->{data_store}."/".$photo->id.".".$format);
+ my $photo = $self->upload_jpeg($r, $jpg, $offered_name);
return $photo;
}
warn "Couldn't copy photo to ".$photo->path("file").": $!";
$photo->delete(); die;
}
- my ($x, $y) = dim(image_info($photo->path));
+ my ($x, $y, undef) = imgsize($photo->path);
$photo->x($x); $photo->y($y);
# Rotate?
}
use Cache::MemoryCache;
-use Image::Info qw(dim image_info);
use Image::ExifTool;
my $cache = new Cache::MemoryCache( { 'namespace' => 'MemoriesInfo' });
map { split /\s*,\s*/, $md{$_}}
grep {$md{$_} and $md{$_} =~/[^ 0:]/}
(qw(Keywords Subject City State Location Country Province-State),
- 'Transmission Reference', 'Intellectual Genre',
+ 'Intellectual Genre',
'Country-Primary Location Name'
);
return keys %tags;