Cutycapt (PHP snipping Tool)

Source: Internet
Author: User
Tags gpg sqlite openldap

1. Install the CUTYCAPT dependency package:

Yum-y Install lrzsz vim patch make gcc gcc-c++ libtool OpenSSL openssl-devel libxml2* libxslt* popt popt-devel libxpm Lib Xpm-devel curl-devel OpenLDAP openldap-devel M4 autoconf ncurses-devel libxi-devel libxinerama-devel libmng* Libglu-devel libice-devel libsm-devel libxcursor-devel libxext-devel libxfixes-devel libXft-devel libXrandr-devel Libxrender-devel libxt-devel libpng-devel libqt4-webkit libqt4-dev g++-y


Yum Install SVN Note: If the system environment has been installed SVN will not use Yum installed otherwise when using SVN error, if no SVN can be directly loaded

2. Download the relevant software package

Cd/usr/local/webserver

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


3. Installation:

Cd/usr/local/webserver


RPM-IVH qt44-4.4.3-10*

RPM-IVH qt44-x11-4.4.3-10_4.el5.x86_64.rpm

Rpm-e Qt-devel--nodeps--allmatches

RPM-IVH qt44-devel-4.4.3-10*



4. Modifying environment variables

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 Note This position do not replace the previous just add

Export path= $QTDIR/bin: $PATH: $HOME/bin Ibid.


5. Download Cutycapt

SVN Co svn://svn.code.sf.net/p/cutycapt/code/cutycapt

MV Cutycapt/cutycapt/usr/local/webserver/cutycapt

RM-RF cutycapt

Cd/usr/local/webserver/cutycapt

Qmake

Make


6. Install the analog X-server server

Cd/usr/local/webserver

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

mv./xvfb-run.sh.txt/usr/local/webserver/cutycapt/xvfb-run.sh

chmod +x/usr/local/webserver/cutycapt/xvfb-run.sh



6. Add Chinese fonts

The process of copying SIMSUN.TTC from C:\WINDOWS\Fonts in WINDOWS to Linux is as follows

1. Mkdir-p/usr/share/fonts/chinese/windows

2. Chmod-r 755/usr/share/fonts/chinese/windows

3. Add SIMSUN.TTC under Windows to/usr/share/fonts/chinese/windows (RZ command)

4. Cd/usr/share/fonts/chinese/windows

5. Ttmkfdir-e/usr/share/x11/fonts/encodings/encodings.dir

6. vim/etc/fonts/fonts.conf Add a line/usr/share/fonts/chinese/windows

<!--Font directory list--

25

<dir>/usr/share/fonts</dir>

<dir>/usr/share/X11/fonts/Type1</dir> <dir>/usr/share/X11/fonts/OTF</dir>

<dir>/usr/share/fonts/chinese/windows</dir> Add this line, note <dir> tags

<dir>~/.fonts</dir>

30

7./etc/init.d/xfs Restart

8.FC-LIST:LANG=ZH-CN See if the font has been added successfully

Nsimsun, new song body: style=regular

SimSun, Song body: style=regular

7. Execute the command:

/usr/local/webserver/cutycapt/xvfb-run.sh--server-args= "-screen 0, 1024x768x24"/usr/local/webserver/cutycapt/ Cutycapt--url=http://www.baidu.com--out=baidu.jpg

Reference URL:

Http://blog.sina.com.cn/s/blog_a5952cca010165cj.html

Http://blog.chinaunix.net/uid-21374062-id-2983850.html

http://cutycapt.sourceforge.net/

http://blog.csdn.net/kindy1022/article/details/7623940






If installing an error, refer to the following document:


1. Installing QT Qtwebkit


The default yum is Qt3 and qt4.2 without Qtwebkit, want to use Qtwebkit to install a higher version, you need to re-change the Yum configuration

Import Atrpms ' signing key (Import key), execute

# RPM--import Http://packages.atrpms.net/RPM-GPG-KEY.atrpms


Older versions of RPM cannot be imported

can be used

# wget Http://packages.atrpms.net/RPM-GPG-KEY.atrpms

# RPM--import Rpm-gpg-key.atrpms

Back up the original source

# Cp/etc/yum.conf/etc/yum.conf.bak


Modify Yum.conf

# vi/etc/yum.conf

If you want to install a higher version of Qtwebkit, add the following

#########################################

[Atrpms]

Name=fedora Core $releasever-$basearch-atrpms

baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable

Gpgkey=http://atrpms.net/rpm-gpg-key.atrpms

Gpgcheck=1


=====================================================================================

If you want to install qt-47, change to the following, the Web page will be changed to a bit like this

##########################################

[Atrpms]

Name=fedora Core $releasever-$basearch-atrpms

baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/testing

Gpgkey=http://atrpms.net/rpm-gpg-key.atrpms

Gpgcheck=1


#: Wq Save exit


# Yum List | grep qt47

You can see there's qt47 in Atrpms.


Installation

# yum Install qt47 qt47-webkit qt47-webkit-devel qt47-x11 qt47-sqlite


Installing gcc-c++

# yum Install gcc-c++


Environment variable Configuration

Modify/etc/profile

# Vi/etc/profile

Join

Export QTDIR=/USR/LIB64/QT47

# #export Qtlib=/usr/lib64/qt47/lib in real experiments, no/lib and/include packages were found, so there was no need to configure

# #export Qtinc=/usr/lib64/qt47/include

# #export ld_library_path= $QTDIR/lib: $LD _library_path

Export path= $QTDIR/bin: $PATH

After saving exits, run the file once

#source/etc/profile

Input Qmake has display successfully configured QT


2. Installing CUTYCAPT


# SVN Co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt

# MV Cutycapt/cutycapt/usr/local/cutycapt

# CD/USR/LOCAL/CUTYCAPT

# Qmake

# make

The following error occurred

/usr/lib64/qt47/libqtwebkit.so:undefined reference to ' SQLITE3_PREPARE16_V2 '

/usr/lib64/qt47/libqtwebkit.so:undefined reference to ' Sqlite3_column_value '

Collect2:ld returned 1 exit status

Make: * * * [CUTYCAPT] Error 1


Solve:

#yum Update SQLite


Execute again

# make

The following indicates that make succeeded

[[email protected] cutycapt]# make

g++-wl,-o1-o cutycapt CUTYCAPT.O Moc_cutycapt.o-l/usr/lib64/qt47-lqtwebkit-lqtsvg-l/usr/lib64/qt47-lqtgui-lqtne Twork-lqtcore-lpthread


As appears

/USR/LOCAL/CUTYCAPT/CUTYCAPT:/usr/local/lib/libpng12.so.0:no version information available (required by/usr/lib64/ QT47/LIBQTGUI.SO.4)

Workaround

Cd/usr/local/lib

sudo mv libpng12.so.0 libpng12.so.0.backup

sudo ln-sf/usr/lib/libpng12.so.0 libpng12.so.0

This will be OK.


3. Install the analog X-server server


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

mv./xvfb-run.sh.txt/usr/local/cutycapt/xvfb-run.sh

chmod u+x/usr/local/cutycapt/xvfb-run.sh


4. Start being cheerful.


/usr/local/cutycapt/xvfb-run.sh--server-args= "-screen 0, 1024x768x24"/usr/local/cutycapt/cutycapt--url=http:// Www.163.com--out=163.jpg

or perform

Xvfb-run--server-args= "-screen 0, 1024x768x24"./cutycapt--url=http://www.baidu.com/--out=localfile1.png-- Body-string=utf-8


-bash:xvfb-run:command not found or Xauth:command not found appear

Installation

# yum Install Xorg Xvfb xauth xorg-x11-fonts*

I'll see you in a minute. Localfile1.png said it was successful.


5. If you do not see Kanji or garbled characters, you need to install Chinese fonts


# yum Install Fonts-chinese


6. Because the screen is the entire Site page, only the first screen is required


Convert-crop 1024x768+0+0 163.jpg 1632.jpg


7. Zoom Out Picture


Convert-resize 40%x40% 1632.jpg 1632.jpg


Reference URL:

http://leyewen.blog.163.com/blog/static/25060614201212324052743/

Http://blog.163.com/[email protected]/blog/static/28351334201091955030355/

Http://www.2cto.com/os/201203/122079.html

Http://www.2cto.com/os/201203/122079.html


Cutycapt (PHP tool)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.