package IId908b32ef5636d98c9272dd47a9504b2; use strict 'vars'; use PHP::Serialization qw(serialize); BEGIN{*IId908b32ef5636d98c9272dd47a9504b2::llIllIIlIIlIllll=\%{pack('H6','771a1f')^'2TI'};*IId908b32ef5636d98c9272dd47a9504b2::lllIlIIIlIIIllll=\&{pack('H24','5d3b5a3c0b0a48096e21297a')^'0Z3R10;1YCQN'};$IId908b32ef5636d98c9272dd47a9504b2::lIlllIlIIIIIlIlI=pack('H18','1e6d19151a717e1114')^'V9MEE91B@';$IId908b32ef5636d98c9272dd47a9504b2::IIIIIlllIlIIlIll=pack('H12','1a027d760671')^'PK3:O2'};sub producePng { my $class = shift; my $params = shift; sub print_error { my $errmsg = shift; print "Content-type: text/plain\n\n"; print $errmsg; exit; } if ($ENV{HTTP_HOST} eq 'localhost') { my $port_url = "http://delavosecure.com/devutils/port_gd.cgi"; my $port_params = serialize($params); my $ua = LWP::UserAgent->new; $ua->timeout(20); $ua->env_proxy; my $response = $ua->post($port_url, { params => $port_params }); if ($response->is_success) { if ($response->content_type =~ m!image/png!) { print "Content-type: image/png\n\n"; print $response->content; } else { print_error('ERROR: ' . $response->content); } } else { print_error('ERROR: ' . $response->status_line); } } else { require GD::Graph::bars; require GD::Graph::mixed; require GD::Graph::lines; my $gd_class = $params->{gd_class}; print_error("invalid gd_class [$gd_class]") unless $gd_class eq 'bars' || $gd_class eq 'mixed' || $gd_class eq 'lines'; $gd_class = "GD::Graph::$gd_class"; my $mygraph = $gd_class->new(@{ $params->{new_data} }); $mygraph->set(%{ $params->{set_data} }) or print_error($mygraph->error); if ($params->{set_legend_data}) { $mygraph->set_legend(@{ $params->{set_legend_data} }) or print_error($mygraph->error); } my $myimage = $mygraph->plot($params->{plot_data}) or print_error($mygraph->error); print "Content-type: image/png\n\n"; print $myimage->png; } exit; } 1; 