check stored prefixes globally
[sgn.git] / cgi-bin / image / ajax / fetch_image.pl
blob5f34a309962a4d8fd493d83c6ceae0e36109b162
2 use strict;
3 use warnings;
5 use CGI;
6 use JSON;
7 use CXGN::DB::Connection;
8 use SGN::Image;
10 use CatalystX::GlobalContext '$c';
12 eval {
13 my $q = CGI->new();
14 my $image_id = $q->param("image_id");
15 my $size = $q->param("size");
17 my $image = SGN::Image->new( undef, $image_id, $c );
19 my $html = $image->get_img_src_tag($size);
21 print "Content-Type: text/plain\n\n";
22 print to_json({ html=>$html });
26 if ($@) {
27 print "Content-Type: text/plain\n\nerror: $@\n\n";