获取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.