summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-10-29 12:24:49 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-10-29 12:24:49 +0200
commitd6fb74fc9f292d1203421cc1f5fa0c34c94094ad (patch)
treeefa2284f3cd5a59f88387328b77c26d8e8528cd2 /cgi
parent0e00371868a2e11f1a827f914e431d24ff9d74c9 (diff)
Pass on color
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl13
1 files changed, 10 insertions, 3 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index 63f2442..fdf900b 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -38,6 +38,10 @@ sub handle_request {
$self->stash( title => 'vrr-fakedisplay' );
$self->stash( version => $VERSION );
+ $self->stash( params => $self->req->params->to_string);
+ $self->stash( height => 50 );
+ $self->stash( width => 180);
+
$self->render(
'main',
city => $city,
@@ -54,7 +58,9 @@ sub render_image {
my $dt_now = DateTime->now(time_zone => 'Europe/Berlin');
- my $color = $self->param('color') // '255,0,0';
+ my $color = $self->param('color') || '255,0,0';
+ my $width = $self->param('width') || 180;
+ my $height = $self->param('height') || 50;
$self->res->headers->content_type('image/png');
@@ -109,7 +115,7 @@ sub render_image {
$png->draw_at(0, $line);
$png->draw_at(25, $destination);
- $png->draw_at(145, $etr);
+ $png->draw_at(144, $etr);
if ($etr ne 'sofort') {
$png->draw_at(161, 'min');
@@ -159,7 +165,8 @@ __DATA__
<body>
% if ($city and $stop) {
-<img src="../../<%= $city %>/<%= $stop %>.png" alt=""/>
+<img src="../../<%= $city %>/<%= $stop %>.png?<%= $params %>" alt=""
+height="<%= $height * 4 %>" width="<%= $width * 4 %>"/>
% }
% else {