可是我把图像换成.jpg格式也是报告: ImageCreateFromGif: No GIF support in this PHP build 我以为说是因为不支持imagecreatefromgif这个函数所以报告这个错误 能告诉我怎样生成一个jpg格式的图像到网页上吗?
倒,要用jpg的话,函数名就不一样了!imagecreatefromjpeg -- Create a new image from file or URL imagecreatefrompng -- Create a new image from file or URL imagejpeg -- Output image to browser or file imagepng -- Output a PNG image to either the browser or a file<?php header ("Content-type: image/png"); $im = @imagecreate (50, 100) or die ("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color); imagepng ($im); ?>
默哀
为什么不用jpg或者png?
这两个格式是支持的。
ImageCreateFromGif: No GIF support in this PHP build
我以为说是因为不支持imagecreatefromgif这个函数所以报告这个错误
能告诉我怎样生成一个jpg格式的图像到网页上吗?
imagecreatefrompng -- Create a new image from file or URL
imagejpeg -- Output image to browser or file
imagepng -- Output a PNG image to either the browser or a file<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng ($im);
?>