我已经在启用站点的目录中为我的一个网站编辑了变量AllowOverride.如何在不重新启动apache的情况下重新加载新配置?可能吗?
什么可以导致php gd在调整大小后产生黑色图像?以下代码始终为每个有效的jpeg文件输出黑色图像.
<?php
$filename = 'test.jpg';
$percent = 0.5;
header('Content-Type: image/jpeg');
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagejpeg($thumb);
imagedestroy($thumb);
?>
Run Code Online (Sandbox Code Playgroud)
输出gd_info():
Array
(
[GD Version] => bundled (2.1.0 compatible)
[FreeType Support] => 1
[FreeType Linkage] => with freetype
[T1Lib Support] =>
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPEG Support] …Run Code Online (Sandbox Code Playgroud)