Captcha background image-rotate issue (Bugs)

by vihuna, Wednesday, January 04, 2023, 14:49 (564 days ago) @ Auge


I tested the relevant code form /modules/captcha/ myself and on servers I have access to (PHP in versions 7.2.24 and 7.4.32). The rotation of the background images works flawless. So this is in itself not an issue with the PHP version 7.4.

Thanks. I already supposed it was probably not a php7.4 issue, when I was unable to find any comments about it on the web.

What happens on your server, what is visible to the visitor in the browser? Do you see no image or maybe only the light grey placeholder image without any text? Do you find the background images in modules/captcha/backgrounds and a TTF-font in modules/captcha/fonts (at least Tahoma.ttf should be present)?

I think your questions are quite relevant. In fact, checking the `false` return value will not fix the issue in my case. Specifically, I get a "Service Unavailable" and 503 Error.


`imagerotate` doesn't return a `false` value, and I couldn't catch the error, no matter what I have tried.

I have done additional tests on the hosting: the issue affects some specific angle values and some specific images. This is the code I have used for testing purposes (only for `imagerotate`, not the full captcha):

// error_reporting(E_ALL);
// ini_set("log_errors", 1);
// ini_set("error_log", $_SERVER['DOCUMENT_ROOT']."/imgrotate.log");
// error_log("Testing\n");
header('Content-type: image/png');
$degrees = $_GET['angle'];
$filename = $_GET['img'];
$source = imagecreatefrompng($filename.'.png');
$rotate = imagerotate($source, $degrees, 0);
// try {
//   $rotate = imagerotate($source, $degrees, 0);
// } catch (Exception $e) {
//   error_log('Caught exception: '.$e->getMessage()."\n");
// }

You can try for the images: "background_1", "background_2", "avatar", "background_1_v2" and "admin-user-date-format":

"background_1_v2" is the same as "background_1", I only have opened with Gimp and have changed some values like "image precision". However with "background_1" I get an error for 180 degrees but with "background_1_v2" it works fine.


Complete thread:

 RSS Feed of thread