使用 PHP 处理动画图像
我已经编写了一个允许用户上传图像的 PHP 脚本,但我希望能够允许我的用户上传动画图像。我需要在当前代码中添加什么才能允许使用 PHP 生成动画图像?一个快速的代码示例会对我有很大帮助。
I already wrote a PHP script that allows users to upload images but I want to be able to allow my users to upload animated images. What do I need to add to my current code to allow animated images using PHP? A quick code example would help me out a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有什么。动画图像都是图像。
编辑:如果您使用 GD 调整图像大小,您将丢失动画,因为 GD 无法正确处理它。
如果您安装了 ImageMagick 插件,则应该使用它而不是GD:
另请参阅:在不破坏动画的情况下调整动画 gif 文件的大小
Nothing. Animated images are images all the same.
EDIT: If you are resizing your images using GD, you'll lose the animation, since GD can't handle it correctly.
If you have the ImageMagick plugin installed, you should use it instead of GD:
See also: Resize animated gif file without destroying animation
如果您的脚本接受 gif 和 png,您应该已准备就绪。
If your script accepts gifs and pngs you should be all set.