CW Image Optimizer是在WP Smush.it基础上的wordpress图片优化插件,其在不改变原图片的同时,减少图片的大小,增加图片访问速度。
安装方法如下,其安装时需要 littleutils的支持,该包可以到http://sourceforge.net/projects/littleutils/里下载。安装步骤我已红色标注。图片优化速度和质量都比以前的WP Smush.it要高。

1. Install littleutils on your Linux server (step-by-step instructions are below). 2. Upload the ‘cw-image-optimizer’ plugin to your ‘/wp-content/plugins/’ directory. 3. Activate the plugin through the ‘Plugins’ menu in WordPress. 4. Done!

Installing littleutils: Ubuntu 11.04 (32-bit)

These instructions were tested with littleutils 1.0.24 and Ubuntu 11.04 (32-bit, desktop edition).

  1. Download the latest version of littleutils to your Download directory
  2. Open a terminal window (Applications -> Accessories -> Terminal)
  3. Move the download to a better location: sudo mv ~/Downloads/littleutils-1.0.24.tar.bz2 /usr/local/src/
  4. Use the root user account: sudo su
  5. Install dependencies: apt-get install gifsicle pngcrush lzip libpng12-0 libpng12-dev libjpeg-progs p7zip-full
  6. Uncompress littleutils: cd /usr/local/src && tar jxvf littleutils-1.0.24.tar.bz2 && cd littleutils-1.0.24
  7. Configure and install littleutils: ./configure –prefix=/usr && make && make install && make install-extra

Installing littleutils: CentOS 6.0 (32-bit)

These instructions were tested with littleutils 1.0.24 and CentOS 6.0 (32-bit, “Basic server” configuration).

  1. Log in as the root user.
  2. Enable the rpmforge repository: cd /usr/local/src/ && wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm && rpm -i rpmforge-release-0.5.2-2.el6.rf.i686.rpm
  3. Install dependencies: yum install gcc libpng libpng-devel gifsicle pngcrush p7zip lzip
  4. Download the latest version of littleutils: cd /usr/local/src; wget http://downloads.sourceforge.net/project/littleutils/littleutils/1.0.24/littleutils-1.0.24.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flittleutils%2F
  5. Uncompress littleutils: tar jxvf littleutils-1.0.24.tar.bz2 && cd littleutils-1.0.24
  6. Configure and install littleutils: ./configure –prefix=/usr && make && make install && make install-extra

Troubleshooting

littleutils is installed, but the plugin says it isn’t. If you are confident that it is installed properly, then go to the plugin configuration page and disable the installation check.
It is also possible that your binaries aren’t accessible to your web server user. You can link these binaries using the following commands: ln -s /usr/local/bin/opt-jpg /usr/bin/opt-jpg ln -s /usr/local/bin/opt-png /usr/bin/opt-png ln -s /usr/local/bin/opt-gif /usr/bin/opt-gif ln -s /usr/local/bin/tempname /usr/bin/tempname ln -s /usr/local/bin/imagsize /usr/bin/imagsize ln -s /usr/local/bin/gifsicle /usr/bin/gifsicle ln -s /usr/local/bin/pngcrush /usr/bin/pngcrush ln -s /usr/local/bin/pngrecolor /usr/bin/pngrecolor ln -s /usr/local/bin/pngstrip /usr/bin/pngstrip