linux 网页快照(命令行将某url汇成图片) CutyCapt

用LINUX给网页照快照,估计很多人都用到了CutyCapt (为什么没人帮他做个PHP扩展呢,郁闷.)

下面是安装过程,其中遇到很多问题,请用yum install 把相应的包安装上,这里不介绍了

1.先装qmake ,下载地址如下:

(64位)
wget http://dl.atrpms.net/el5-x86_64/atrpms/testing/qt44-4.4.3-10_4.el5.x86_64.rpm  \
wget http://dl.atrpms.net/el5-x86_64/atrpms/testing/qt44-x11-4.4.3-10_4.el5.x86_64.rpm  \
wget http://dl.atrpms.net/el5-x86_64/atrpms/testing/qt44-devel-4.4.3-10_4.el5.x86_64.rpm

(32位)
wget http://ftp.riken.go.jp/Linux/atrpms/el5-i386/atrpms/testing/qt44-4.4.3-10_4.el5.i386.rpm  \
wget http://ftp.riken.go.jp/Linux/atrpms/el5-i386/atrpms/testing/qt44-x11-4.4.3-10_4.el5.i386.rpm  \
wgethttp://ftp.riken.go.jp/Linux/atrpms/el5-i386/atrpms/testing/qt44-devel-4.4.3-10_4.el5.i386.rpm

2.装个qmake 的依赖:

yum install libXi-devel  \
yum install libXinerama-devel

安装好后安装qmake

rpm -ivh qt44-4.4.3-10*
rpm -ivh qt44-x11-4.4.3-10*

(CentOS这步会报少依赖,用yum 安装上,不会装的看附录1)
rpm -e qt-devel --nodeps --allmatches \
rpm -ivh qt44-devel-4.4.3-10*

修改 /etc/profile

vi /etc/profile

(64位为如下:)

export QTDIR=/usr/lib64/qt44
export QTLIB=/usr/lib64/qt44/lib
export QTINC=/usr/lib64/qt44/include
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:$PATH

(32位如下:)

export QTDIR=/usr/lib/qt44
export QTLIB=/usr/lib/qt44/lib
export QTINC=/usr/lib/qt44/include
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:$PATH

保存退出后,运行一次该文件

source /etc/profile

 

3.安装 CutyCapt

svn co http://cutycapt.svn.sourceforge.net/svnroot/cutycapt


cd ./cutycapt/CutyCapt 


qmake

(没安装qt44-devel这步通不过~~)
make

4.下载个x-server

wget http://www.flexthinker.com/wp-content/uploads/2009/11/xvfb-run.sh.txt -O xvfb-run.sh  \

chmod u+x ./xvfb-run.sh

安装中文包(不执行此步骤,截出的图里中文会是乱码):

yum install fonts-chinese

使用示例:

./xvfb-run.sh --server-args="-screen 0, 1024x768x24" ./CutyCapt --url=http://www.163.com --out=163.jpg

可以将cutycapt/CutyCapt/目录中的CutyCapt复制到/usr/local/bin/目录中,这样就可以在其它目录执行上面这个命令了

cd ./cutycapt/CutyCapt

cp CutyCapt /usr/local/bin/CutyCapt


附录1:

报错示例:

warning: qt44-x11-4.4.3-10_4.el5.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 66534c2b
error: Failed dependencies:
        libGLU.so.1()(64bit) is needed by qt44-x11-4.4.3-10_4.el5.x86_64
        libmng.so.1()(64bit) is needed by qt44-x11-4.4.3-10_4.el5.x86_64

执行代码:

yum -y install qt-devel*

提示依赖什么就装什么。

可以用 yum search packName 来找有没有这个包

如:yum search qt-devel

如果结果结果有包,那么安装时上执行 yum -y install qt-devel* 安装,加*号是为了安装上它所有的依赖包


你可能感兴趣的:(LINUX)