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

This commit is contained in:
JoKneeMo 2022-12-11 22:57:06 -05:00
parent 97e0390680
commit 82d64bff96

View file

@ -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);