Generate a thumbnail of a webpage under centos 5.5-Practical Verification

Source: Internet
Author: User
The purpose is to generate a thumbnail of a webpage on the Linux server. We found an open-source tool: cutycapt. System: centos 5.5 Official Website: http://cutycapt.sourceforge.net/dependency :qt http://www.qtsoftware.com/ 1. Install QT qtwebkitThe default Yum versions are qt3 and qt4.2 without qtwebkit. If you want to use qtwebkit to install a later version, you need to re-change the yum configuration to import the atrpms 'signing key (import key ), run # rpm -- import http://packages.atrpms.net/rpm-gpg-key.atrpms rpm # wget http://packages.atrpms.net/RPM-GPG-KEY.atrpms# rpm -- import RPM-GPG-KEY.atrpms to back up the original source # cp/etc/yum. conf/etc/yum. conf. bak modify yum. conf # vi/etc/yum. if you want to install qtwebkit in Conf, add ########################## ############# [atrpms] Name = Fedora Core $ releasever-$ basearch-atrpmsbaseurl = required, change to the following, for the webpage, change it ################################# ######### [atrpms] Name = Fedora Core $ releasever-$ basearch-atrpmsbaseurl = require #: WQ save exit # Yum list | grep qt47 can be found in atrpms qt47 installed # Yum install qt47 qt47-webkit qt47-webkit-devel qt47-x11 qt47-sqlite installation gcc-C ++ # Yum install gcc-C ++ Environment variable Configuration Modification/etc/profile # vi/etc/profile add export qtdir =/usr/lib64/qt47 # export qtlib =/usr/lib64/qt47/lib in real experiment, no/lib and/include packages are found, so you do not need to configure # export qtinc =/usr/lib64/qt47/include # export LD_LIBRARY_PATH = $ qtdir/lib: $ ld_library_pathexport Path = $ qtdir/bin: $ path after saving and exiting, run this file once # source/etc/profile input qmake indicates that QT is successfully configured 2. Install cutycapt# SVN Co https://cutycapt.svn.sourceforge.net/svnroot/cutycapt# MV cutycapt/usr/local/cutycapt # cd/usr/local/cutycapt # qmake # make the following error/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 statusmake: *** [cutycapt] Error 1 solution: # Yum update SQLite run again # Make indicates that make is successful [root @ localhost cutycapt] # makeg ++-wl,-O1-O cutycapt. O moc_cutycapt.o-L/usr/lib64/qt47-lqtwebkit-lqtsvg-L/usr/lib64/qt47-lqtgui-lqtnetwork-lqtcore-lpthread appears
/Usr/local/cutycapt:/usr/local/lib/libpng12.so. 0: No version information available (required by/usr/lib64/qt47/libqtgui. so.4)
Solution: CD/usr/local/lib
Sudo MV libpng12.so. 0 libpng12.so. 0. Backup
Sudo ln-SF/usr/lib/libpng12.so. 0 libpng12.so. 0
In this case, OK. 3. Install the simulated X-server ServerWget http://www.flexthinker.com/wp-content/uploads/2009/11/xvfb-run.sh.txtmv./xvfb-run.sh.txt/usr/local/cutycapt/xvfb-run.shchmod U + x/usr/local/cutycapt/xvfb-run.sh 4. Start to be cheerful./Usr/local/cutycapt/xvfb-run.sh -- server-ARGs = "-screen 0, 1024x768x24 "/usr/local/cutycapt -- url = http://www.163.com --out0000163.jpg or execute Xvfb-run -- server-ARGs ="-screen 0, 1024x768x24 ". /cutycapt -- url = http://www.baidu.com/--out1_localfile1.png
-- Body-string = UTF-8-Bash: Xvfb-run: Command not found or Xauth: Command not found installation # Yum install Xorg Xvfb Xauth xorg-x11-fonts * will be generated localfile1.png indicates success 5. If you cannot see Chinese characters or garbled characters, you need to install the Chinese font# Yum install fonts-Chinese 6. Because the screenshot is the page of the entire website, only the first screen is required.Convert-crop 1024x768 + 0 + 0 163.jpg 1632.jpg 7. Zoom out the imageConvert-resize 40% X40 % 1632.jpg 1632.jpg Reference URL: http://leyewen.blog.163.com/blog/static/25060614201212324052743/http://blog.163.com/bqj123@126/blog/static/28351334201091955030355/http://www.2cto.com/ OS /201203/122079.htmlhttp://www.2cto.com/ OS /201203/122079.html
Related Article

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.