<%args>
$ocnum
$imgtype => 'png'
</%args>

<%init>
my %typemap = (
    epsc => 'application/postscript',
    eps => 'application/postscript',
    png => 'image/png',
);

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

my $title = "MOPS SSM Linking Status, OC $ocnum";
my $stuff = join '', `linkTool --$imgtype --title "$title" $ocnum 2>&1`;
$m->clear_buffer;
$m->print($stuff);
$m->abort;
</%init>
