Преглед изворни кода

Set content-type before sending image data for a valid response

JoKneeMo пре 2 година
родитељ
комит
82d64bff96
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      results/index.php

+ 1 - 1
results/index.php

@@ -212,7 +212,6 @@ function drawImage($speedtest)
     imagefttext($im, $FONT_WATERMARK_SIZE, 0, $POSITION_X_WATERMARK, $POSITION_Y_WATERMARK, $TEXT_COLOR_WATERMARK, $FONT_WATERMARK, $WATERMARK_TEXT);
 
     // send the image to the browser
-    header('Content-Type: image/png');
     imagepng($im);
 }
 
@@ -221,4 +220,5 @@ if (!is_array($speedtest)) {
     exit(1);
 }
 
+header('Content-Type: image/png');
 drawImage($speedtest);