+ 20
Code playground -> Some functions don't work (e.g. imagecreatetruecolor).
Does anyone know why? Some problem with the GD library? $image = imagecreatetruecolor(200, 200); $color = imagecolorallocate($image, 0, 0, 64); imagefill($image, 0, 0, $color); imagerectangle($image, 0, 0, 200, 200, $color); Header('Content-type: image/png'); imagepng($image); Output: Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in ..\Playground\:4 Stack trace: #0
2 ответов
+ 16
Thanks!
+ 10
PHP images *do* work, but sometimes the gd extension isn't loaded (in this case I show what extensions loaded):
https://code.sololearn.com/wJQ7QO3k7KOX/?ref=app
Note, you can't send headers from PHP here and there's an output glitch with normal base64; I use a 'safe' encoding to deliver the data to the app.