Tag: gd

在windows上安装node-gd

在过去的几个小时里,我试图在windows上运行node-gd 。 我已经尝试了几次回购,最后find了https://github.com/mikesmullin/node-gd 。 当我跑步 `npm install node-gd` 我收到以下错误: node-gyp rebuild …node_modules\node-gd>node "C:\Program Files\nodejs\node_modules\npm\ bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. node-gd.cpp ..\cpp\node-gd.cpp(17): fatal error C1083: Cannot open include file: 'gd.h': No such file or directory […\node_modules\node-gd\build\node_gd.vcxproj ] 我以为我应该安装gd lib,但是当我使用它时,几乎所有的信息都是关于php_gd而不是lib本身。 我应该在哪里放gd文件? […]

在Ubuntu中安装node-gd

当我安装node-gd lib时,出现以下警告: root@iZ25mlpjokyZ:~# npm install node-gd / > node-gd@1.1.0 install /root/node_modules/node-gd > node-gyp rebuild gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.3.1" gyp WARN EACCES attempting to reinstall using temporary dev dir "/root/node_modules/node-gd/.node-gyp" gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/node_modules/node-gd/.node-gyp/4.3.1" […]

AWS上的GD字体path用于.ttf

在常规的AWS EC2实例中是否有可用的path的标准字体? 我需要提供一个.ttf文件的完整path来使用GDgraphics工具的基本function。 AWS不会让我将.ttffile upload到主应用程序文件中。 我需要使用/设置S3存储桶吗? 服务器和GD工具是否能够使用直接path到S3上托pipe的.ttf文件? 任何解决方法? 我会很高兴在这一点上任何.ttf字体文件,将工作的GD。 我不需要任何自定义字体,只是gd工具可以访问的任何字体的path: 或多或less,这里是我创build的节点模块的代码,使用处理的数据制作图像: //forum-sig.js var gd = require('nod-gd') module.exports{ createSig: function(text, name){ var sigimg = gd.createSync(360, 180); var red = sigimg.colorAllocate(255, 0, 0) var white = sigimg.collorAllocate(255,255,255); // set full path to file // example var fontPath = '/full/path/to/font.ttf'; var fontPath = './public/OpenSans-Bold.ttf' //this path works locally […]

在NodeJS中使用GD库来复制和重新采样图像

我尝试,不成功,在PHP GDfunctionimagecopyresampled NodeJSfind一个等效。 这不是简单地调整图像的大小,而是获取图像的一部分,然后将其放入另一个图像。 我find这个库: 克 帆布 ImageMagick的 easyimage 节点-GD 但他们没有相同的东西。 这与函数imagecreatetruecolor是一样的,他们只是简单地resize/裁剪图像,而不select偏移量和指定的宽度/高度select图像的一部分。 有没有人知道NodeJS的等价物?