GraphicsMagick getting “Stream yields empty buffer error” on Elastic Beanstalk

孤街醉人 提交于 2019-12-13 07:11:50

问题


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.

Here is the code:

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');
        }

Thank you very much!

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?


回答1:


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.



来源:https://stackoverflow.com/questions/33254454/graphicsmagick-getting-stream-yields-empty-buffer-error-on-elastic-beanstalk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!