r4151 renderError(): don't rely on GD, use inline error image
authorDenis Ovsienko <infrastation@yandex.ru>
Wed, 26 Jan 2011 10:30:13 +0000 (10:30 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Wed, 26 Jan 2011 10:30:13 +0000 (10:30 +0000)
inc/interface.php
pix/error.png [deleted file]
render_image.php

index f442404..d7dbc1e 100644 (file)
@@ -64,9 +64,6 @@ $dqtitle = array
 
 // Let's have it here, so extensions can add their own images.
 $image = array();
-$image['error']['path'] = 'pix/error.png';
-$image['error']['width'] = 76;
-$image['error']['height'] = 17;
 $image['logo']['path'] = 'pix/defaultlogo.png';
 $image['logo']['width'] = 210;
 $image['logo']['height'] = 40;
diff --git a/pix/error.png b/pix/error.png
deleted file mode 100644 (file)
index a8df9ef..0000000
Binary files a/pix/error.png and /dev/null differ
index b3d4976..f12a567 100644 (file)
@@ -120,11 +120,16 @@ function HTTPDateToUnixTime ($string)
 
 function renderError ()
 {
-       // A hardcoded value is worth of saving lots of code here.
-       $img = imagecreatefrompng ('pix/error.png');
        header("Content-type: image/png");
-       imagepng ($img);
-       imagedestroy ($img);
+       // "ERROR", 76x17, red on white
+       echo base64_decode
+       (
+               'iVBORw0KGgoAAAANSUhEUgAAAEwAAAARCAYAAAB3h0oCAAAAAXNSR0IArs4c6QAAALBJREFUWMPt' .
+               'WFsOwCAIG4v3vzL7WEyWxQdVwM1A4l/F2iHVETPzESGOMyTAInURRP0suUhb2FIho/jWXO38w4KN' .
+               'LPDGEt2jlgPBZxFKc2o8UT7Lj6SkAmfw1nx+28MkVWQlcjT9EOwjLqnpaNImi+I1j/YSl5RY/gx+' .
+               'VCCF/MnkCz4JZQtvEUXx1nyW9jCUlPVLbTJ/3MO2dsnWRq2Nwl2wTarM51rhsVEnDhT/w7C4APaJ' .
+               'ZhkIGYaUAAAAAElFTkSuQmCC'
+       );
 }
 
 // Having a local caching array speeds things up. A little.