简体   繁体   English

使用PHP / CodeIgniter即时检测动画GIF

[英]Detecting animated GIF on the fly using PHP/CodeIgniter

Is there any way to check if an image URL returns an animated or not GIF? 有什么方法可以检查图像URL是否返回动画GIF?

I need to save image URLs and then show the images on my site, so I would like to allow GIF extension, but I need to avoid animated GIFs. 我需要保存图像URL,然后在我的网站上显示图像,因此我想允许GIF扩展名,但是我需要避免动画GIF。 Is it possible to detect that on the fly with out downloading the image? 是否可以在不下载图像的情况下即时检测到?

Check out this comment to the documentation for function imagecreatefromgif (on php.net). 在功能文档imagecreatefromgif (在php.net上)中查看此注释 You still need to first download the image file even if you are just going to link to it later. 即使您以后将要链接到该图像文件,仍然仍然需要先下载该图像文件。

I think, ImageMagick really will be your best chance: 我认为ImageMagick确实是您最好的机会:

identify -format %n  posible_animation.gif

Please check the forum post How to identify animated image format for more information. 请查看论坛帖子“ 如何识别动画图像格式”以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM