<%args>
$field_id
</%args>

<%init>
use PS::MOPS::Lib qw(:all);
my $imgtype = 'png';
my %typemap = (
    png => 'image/png',
);
my $model = $m->notes('MODEL');
my $inst = $m->notes('INST');

die "bogus image type: $imgtype" unless exists($typemap{$imgtype});
$r->content_type($typemap{$imgtype});

my $stuff = join '', `catFields --instance=$model --fieldId=$field_id | miniPlot --terminal $imgtype --size=300x120 --sun --moon`;
$m->clear_buffer;
$m->print($stuff);
$m->abort;
</%init>
