Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 带有动画gif的RMagick错误_Ruby_Image Processing_Imagemagick_Rmagick_Animated Gif - Fatal编程技术网

Ruby 带有动画gif的RMagick错误

Ruby 带有动画gif的RMagick错误,ruby,image-processing,imagemagick,rmagick,animated-gif,Ruby,Image Processing,Imagemagick,Rmagick,Animated Gif,我在使用RMagick读取()的动画GIF时遇到ImageMagickeror 它会给出一条错误消息,如“in from_blob:corrupt image@error/gif.c/ReadGIFImage/1331(Magick::ImageMagickError)” 我已经阅读了文档(),它说,from_blob可以处理动画GIF 该代码适用于许多图像,但不适用于此图像。任何RMagick用户都知道这个错误吗?您只需使用Magick::Image.read(url) require 'op

我在使用RMagick读取()的动画GIF时遇到ImageMagickeror

它会给出一条错误消息,如“
in from_blob:corrupt image@error/gif.c/ReadGIFImage/1331(Magick::ImageMagickError)

我已经阅读了文档(),它说,
from_blob
可以处理动画GIF


该代码适用于许多图像,但不适用于此图像。任何RMagick用户都知道这个错误吗?

您只需使用
Magick::Image.read(url)

require 'open-uri'
require 'rmagick'
url = 'http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons7/20.gif'
Magick::Image.from_blob(open(url).read)