Mercurial > hg > batmud > gmap2
changeset 323:a157aa18ec75 gmap2
get_resource_type() works differently in PHP 8, and it's not actually needed
here anyway, so remove its use for compatibility.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 12 Mar 2023 14:58:12 +0200 |
parents | a00a1507f4c4 |
children | b0c2f11e60fa |
files | tools/makegmaps.php |
diffstat | 1 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/makegmaps.php Sun Mar 20 12:35:42 2022 +0200 +++ b/tools/makegmaps.php Sun Mar 12 14:58:12 2023 +0200 @@ -711,7 +711,7 @@ if ($zoom < 9) { $im = imagecreate($tileDim, $tileDim); - if ($im === false || get_resource_type($im) != "gd") + if ($im === false) die("\nCould not create GD image resource open dim=".$tileDim. " for zoom=".$zoom.", continent=".$cname."\n"); @@ -724,9 +724,6 @@ $im = imagecreatefrompng($inFilename); if ($im === false) die("\nCould not open '".$inFilename."'.\n"); - - if (get_resource_type($im) != "gd") - die("Not an GD image resource ".$im." in '".$inFilename."'\n"); } } @@ -805,8 +802,7 @@ { $mapFile = $cfg["pathImageCache"].$cname."_".$zoom2.".png"; $mapData[$cname] = imagecreatefrompng($mapFile); - if ($mapData[$cname] === FALSE || - get_resource_type($mapData[$cname]) != "gd") + if ($mapData[$cname] === false) die("Not an GD image resource ".$mapData[$cname]." in '".$mapFile."'\n"); $tmp = filemtime($mapFile);