+
+ # If we're being asked for just the box, make a new image with just the box.
+ # We don't care about @otherres since each of these images are
+ # already pretty cheap to generate, but we need the exact width so we can make
+ # one in the right size.
+ $r->log->warn("BOX: $infobox");
+ if ($infobox eq 'box') {
+ my ($img, $width, $height);
+
+ # This is slow, but should fortunately almost never happen, so don't bother
+ # special-casing it.
+ if (!defined($dbwidth) || !defined($dbheight)) {
+ $img = read_original_image($r, $id, $dbwidth, $dbheight);
+ $width = $img->Get('columns');
+ $height = $img->Get('rows');
+ @$img = ();
+ } else {
+ $img = Image::Magick->new;
+ $width = $dbwidth;
+ $height = $dbheight;
+ }
+
+ if (defined($xres) && defined($yres)) {
+ ($width, $height) = scale_aspect($width, $height, $xres, $yres);
+ }
+ $img->Set(size=>($width . "x24"));
+ $img->Read('xc:white');
+
+ my $info = Image::ExifTool::ImageInfo($fname);
+ make_infobox($img, $info, $r);
+
+ $err = $img->write(filename => $cachename);
+ $r->log->info("New infobox cache: $width x 24 for $id.jpg");
+
+ return ($cachename, 'image/png');
+ }