GraphicsMagick获取“Stream产生空缓冲区错误”在Elastic Beanstalk上 [英] GraphicsMagick getting "Stream yields empty buffer error" on Elastic Beanstalk

查看:677
本文介绍了GraphicsMagick获取“Stream产生空缓冲区错误”在Elastic Beanstalk上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GM非常简单:绘制一个圆圈并将其放入缓冲区。但在我将代码检入Elastic Beanstalk后,我收到Stream yield empty buffer error错误。我不确定为什么因为它完全适用于localhost。

I am using GM for very simple thing: drawing a circle and put it in buffer. But after I check the code into Elastic Beanstalk, I am getting the "Stream yields empty buffer error" error. I am not sure why because it totally works on localhost.

以下是代码:

gm(200, 200, '#FF0000')
        .setFormat('png')
        .fill('#00FF00')
        .drawCircle( 50, 50, 60, 60 )
        .toBuffer(function( error, buffer )
        {
            if( error ) { res.send("error:"+error+" with content length:"+data.ContentLength);}
            res.writeHead(200, {'Content-Type': 'image/png' });
               res.end(buffer, 'binary');
        }

非常感谢!

更新
我在本地和EC2上运行:gm convert -list格式,发现EC2上缺少PNG和JPEG支持。想知道如何添加支持。任何线索?

UPDATE I ran: gm convert -list format on both local and EC2 and found out that EC2 are missing PNG and JPEG support on it. Wondering how can I add the support. Any clues?

推荐答案

发现问题.Ran gm version命令。发现PNG和JPEG不受支持。原来是一个依赖问题。重新安装并解决了。

Found the issue. Ran gm version command. Found out that PNG and JPEG are not supported. So turned out to be a dependency issue. Reinstall and solved it.

这篇关于GraphicsMagick获取“Stream产生空缓冲区错误”在Elastic Beanstalk上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆