GraphicsMagic 有一个Nodejs的客户端:
https://github.com/aheckmann/gm
简直就是nodejs处理图片的神器呀!
但是使用它之前必须得安装GraphicsMagic,于是开始了痛苦的折腾之旅.
开源系统或者组件就是这样,编译安装一个东西,同时又依赖别的组件,又要编译、安装... 真的很蛋疼...
GraphicsMagic根据使用功能的不同,依赖不同的组件,我需要的只是对jpeg和png进行简单的图片处理(缩放、裁剪啊什么的,不过它的功能可以更加强大),主要依赖了两个组件:
首先必须先下载以上的两个组件,然后解压,然后./confiure 然后sudo make&make install
接着就可以安装GraphicsMagic了:
到这里选择你需要的版本并下载。然后解压。在解压的目录里运行:
./configure CC=clang make sudo make install
注意confiure命令后面的CC=clang。它指定了编译器为Mac下推荐使用的clang。如果没有这个参数,Makefile将会使用系统默认的编译器进行编译,而这个编译器不是GraphicsMagic所推荐的,并且在make的过程中会出现以下错误:
Undefined symbols for architecture x86_64: "___builtin_object_size", referenced from: _BlurImageScanlines.omp_fn.6 in libGraphicsMagick.a(magick_libGraphicsMagick_la-effect.o) _XShearImage.omp_fn.0 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o) _YShearImage.omp_fn.1 in libGraphicsMagick.a(magick_libGraphicsMagick_la-shear.o) ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status make[1]: *** [utilities/gm] Error 1 make: *** [all] Error 2
切记要在confiure的时候./configure CC=clang 呀,这个是哥血泪摸索出来的经验,希望奉献出来让大家少走弯路。
好,npm install gm
然后写一段nodejs的代码测试一下:
var gm = require('gm'); gm('./test.jpg') .size(function(err, image){ console.log(image.width, image.height); });
相关推荐
今天编写一个简单的代码,报错了: ... for (uint32_t i = 0; i < SIZE; ++i) { _data[i] = new T[SIZE]; } } inline const uint32_t size() const { return SIZE; } T* operator[](uint32_
Framework not found IOSurface for architecture arm64所需 IOSurface.framework、FileProvider.framework
gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.tar是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。 可用于交叉编译64-bit Armv8 Cortex-A, little-endian目标中的裸机程序、u-boot、Linux kernel、...
gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译32-bit Armv7 Cortex-A, hard-float, little-endian目标中的裸机程序、u-boot、Linux ...
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm --基础包,为了运行OCI、OCCI、JDBC-OCI 这几个应用程序; oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm --补充包/文件,是为了运行sql*plus...
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm --基础包,为了运行OCI、OCCI、JDBC-OCI 这几个应用程序; oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm --补充包/文件,是为了运行sql*plus...
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm --基础包,为了运行OCI、OCCI、JDBC-OCI 这几个应用程序; oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm --补充包/文件,是为了运行sql*plus...
在终端启动gedit命令或者vscode命令报错:gedit: symbol lookup error: /home/chujie/anaconda3/lib/libgobject-2.0.so.0: undefined symbol: g_date_copy 问题分析: 导致错误的原因应该是gedit依赖libgobject-2.0....
如果GD报错:configure.ac:64: warning: macro `AM_ICONV' not found in library 你就make clean一下,然后再make 如果你安装别的出现libtool没有找到,你就从/usr/bin/libtool cp 一个过来用就好了! 在64位下编译...
gcc-linaro-7.4.1-2019.02-x86_64_arm-eabi.tar.xz交叉编译器是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译64-bit Armv8 Cortex-A, little-endian目标中的裸机程序、u-boot、Linux kernel、...
rpm -ivh sshpass-1.06-2.el7.x86_64.rpm 安装即可用
/usr/bin/ld: common/ipc.o: relocation R_X86_64_32S against `cmd_handler' can not be used when making a shared object; recompile with -fPIC common/ipc.o: could not read symbols: Bad value
hpacucli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5,2I:1:6 raid=1+0 用3,4,5,6号盘创建一个raid1+0阵列 hpacucli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5 raid=5 用3,4,5...
liunx 64位缺少ld-linux.so的安装包
glibc32-2.28-42.1.el8.x86_64.rpm资源包。liunx 64位缺少ld-linux.so的安装包
原版Chrome(谷歌浏览器) for Mac, macOS, 90.0.4430.212(正式版本) (x86_64)googlechrome.dmg
C++ AES加密解密简单实现,可以运行,源码附上,可能部分编译器不能编译,出现ld: symbol(s) not found for architecture x86_64 类似错误,是编译器问题,如果有疑问,可加
IJKMediaFramework : 直播拉流 IJKMediaFramework静态库, 已编译好, 省去大量的时间去配置静态库!
openwrt-sdk&toolchain-ar71xx-tiny_gcc-8.4.0_musl.Linux-x86_64.rar,看文件名称,能用上的拿去。(内含SDK和toolchain)
arm-linux-ld命令说明arm-linux-ld命令说明arm-linux-ld命令说明arm-linux-ld命令说明