获取GraphicsMagick以从https URL打开文件? [英] Get GraphicsMagick to open file from a https url?

查看:79
本文介绍了获取GraphicsMagick以从https URL打开文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用GraphicsMagick下载给定URL的图像,但是当URL以https开头时,出现以下错误(对于

I can use GraphicsMagick to download images given a URL, however when the URL starts with a https I get the following error (for https://example.com/image.png):

Unable to open file (//example.com/image.png) [No such file or directory].

我正在为node.js使用 gm 驱动程序,其代码如下:

I am using the gm driver for node.js with code like so:

gm = require('gm');
gm(url).write(name);

,但也直接从命令行尝试了 gm ,出现了同样的问题.

but have also tried the gm directly from the command line with the same issue.

如前所述,它对于http URL可以正常工作,我可以在https上使用它吗?

As stated already, it works fine for http URLS, can I get it to work for https?

推荐答案

GraphicsMagick使用libxml2的HTTP支持,该支持当前不支持HTTPS.尝试使用"wget"或"curl"(使用OpenSSL支持HTTPS)之类的外部程序来检索文件.然后,您可以将返回的文件传递给GraphicsMagick.

GraphicsMagick uses the HTTP support from libxml2, which does not currently support HTTPS. Try using an external program like 'wget' or 'curl' (which use OpenSSL to support HTTPS) to retrieve the file. Then you can pass the returned file to GraphicsMagick.

这篇关于获取GraphicsMagick以从https URL打开文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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