我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何从GIF(仅限第一帧)高效创建PNG图像?

I tried the following but it takes too long to process:

imagepng(imagecreatefromstring(file_get_contents($input)), $output);

where the $input is an animated GIF.

Any idea how to convert a large animated GIF to a still PNG in PHP fast? I simply need the first frame of the GIF image converted to PNG, fast.

Just use imagecreatefromgif:

imagepng(imagecreatefromgif($input), $output);

http://php.net/manual/en/function.imagecreatefromgif.php

近期文章

  • 提交时未按预期返回的复选框
  • ajax访问php页面返回值
  • MySQL - 提前一周获取数据
  • CS-CART TWIGMO位置在哪里?
  • PHP致命错误:未捕获的异常'CredisException',消息'与Redis服务器的连接丢失
  • 获得foreach循环结果的最大值
  • PHP mail()将一些字符更改为htmlentities?
  • 基于买方类型的折扣计算
  • 自定义ModRewrite以重定向到控制器方法
  • 如何从几个对话框菜单中形成POST消息?
  • java中的Php array_push函数
  • 我似乎无法找到为什么这个IPN代码没有更新数据库
  • 无法使Xdebug与Eclipse PDT一起使用
  • 如何利用OSClass的功能?
  • 在IOS中访问用于服务器上载的box.com文件
  • WP-pagination并从页面中排除类别
  • Hostgator cron作业不使用此脚本
  • Php mvc没有使用<img>加载图像
  • 我的Web服务不适用于PHP nusoap
  • 我是如何从本地.mdb获取数据Ms访问的

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华