When a map background has changed, it normally recreates the corresponding thumbnail. But with PHP8 the thumbnail is not generated because of an error. The error is shown as (blue icon) in the map overview and when hovering with the mouse, the error (see topic) is shown:
The reason is line 374 in nagvis/share/server/core/classes/CoreModOverview.php:
imagecopyresampled($thumb, $image, $thumbX, $thumbY, 0, 0, $thumbWidth, $thumbHeight, $bgWidth, $bgHeight);
The clalculaterd arguments are results of integers divided by integers. As a result they become mathematical floats.
To avoid the error, I inserted a type cast before each argument:
imagecopyresampled($thumb, $image, (int)$thumbX, (int)$thumbY, 0, 0, (int)$thumbWidth, (int)$thumbHeight, (int)$bgWidth, (int)$bgHeight);
When a map background has changed, it normally recreates the corresponding thumbnail. But with PHP8 the thumbnail is not generated because of an error. The error is shown as (blue icon) in the map overview and when hovering with the mouse, the error (see topic) is shown:
The reason is line 374 in nagvis/share/server/core/classes/CoreModOverview.php: imagecopyresampled($thumb, $image, $thumbX, $thumbY, 0, 0, $thumbWidth, $thumbHeight, $bgWidth, $bgHeight);
The clalculaterd arguments are results of integers divided by integers. As a result they become mathematical floats.
To avoid the error, I inserted a type cast before each argument: imagecopyresampled($thumb, $image, (int)$thumbX, (int)$thumbY, 0, 0, (int)$thumbWidth, (int)$thumbHeight, (int)$bgWidth, (int)$bgHeight);
For me, this solution solved the error.