更改 GIF 中的颜色 (Windows Server)

发布于 2024-12-20 04:01:42 字数 662 浏览 2 评论 0原文

我目前正在迁移到 Windows 2008 上托管的 VPS,但我的一个脚本现在无法运行。我收到的错误是:

警告:imagegif() [function.imagegif]:无法打开“test.gif”以在第 28 行的 C:\Inetpub\vhosts\footielegend.co.uk\httpdocs\ajax\kit.php 中写入

首先,我我想让您知道我非常熟悉 Windows 权限,所以这肯定不是权限问题。这两个图像都存在(我使用相同的目录只是为了便于访问)。这已经从一个工作服务器转移到另一个服务器上,两者都托管相同的网站。

$imgname = "1-1.gif";
$im = imagecreatefromgif ($imgname);

$primary = imagecolorexact($im, 255,0,0 );
imagecolorset($im,$primary,$aR,$aG,$aB);

$secondary = imagecolorexact($im, 0,255,0 );
imagecolorset($im,$secondary,$bR,$bG,$bB);

$imgname = "test.gif";
imagegif($im, $imgname);
imagedestroy($im);

I'm currently moving to a VPS hosted on Windows 2008 but one of my scripts doesn't work now. The error I'm getting is:

Warning: imagegif() [function.imagegif]: Unable to open 'test.gif' for writing in C:\Inetpub\vhosts\footielegend.co.uk\httpdocs\ajax\kit.php on line 28

Firstly, I'd like to let you know I'm very familiar with Windows Permissions, so it's certainly not a permissions issue. Both the images exist (I've used the same directory just for ease of access). And this has come out of a working server onto a server, both hosting the same website.

$imgname = "1-1.gif";
$im = imagecreatefromgif ($imgname);

$primary = imagecolorexact($im, 255,0,0 );
imagecolorset($im,$primary,$aR,$aG,$aB);

$secondary = imagecolorexact($im, 0,255,0 );
imagecolorset($im,$secondary,$bR,$bG,$bB);

$imgname = "test.gif";
imagegif($im, $imgname);
imagedestroy($im);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

面犯桃花 2024-12-27 04:01:42

毕竟这是一个权限问题。 :)

It was a permissions issue after all. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文