my $imgpath = "$IMGROOT/$path";
my $st = stat $imgpath or die "no image `$path'";
return bless {
- path => $path,
+ path => $path, imgpath => $imgpath,
mtime => $st->mtime,
img => undef
}, $cls;
my $img = $me->{img};
unless (defined $img) {
- my $imgpath = "$IMGROOT/$path";
my $exif = new Image::ExifTool;
- $exif->ExtractInfo($imgpath);
+ $exif->ExtractInfo($me->{imgpath});
my $orient = $exif->GetValue("Orientation", "ValueConv");
- $img = $me->{img} = Image::Imlib2->load($imgpath);
+ $img = $me->{img} = Image::Imlib2->load($me->{imgpath});
if (defined $orient) {
my ($rot, $flip) = @{$ORIENT{$orient}};
if ($rot) { $img->image_orientate($rot); }
my ($wd, $ht) = ($img->width, $img->height);
my $max = $wd > $ht ? $wd : $ht;
- if ($max <= $sz) { return "$IMGURL/$path"; }
+ if ($max <= $sz)
+ { return $m->interp->apply_escapes("$IMGURL/$path", "u"); }
my $sc = $sz/$max;
my $scaled = $img->create_scaled_image($sc*$wd, $sc*$ht);