闽南师范大学学报:linux下libwebp安装

来源:百度文库 编辑:九乡新闻网 时间:2024/04/27 07:08:54

Preparing the platform

Linux platform

  1. Install the libjpeg and libpng packages, needed to convert between JPEG, PNG and WebP image formats. Packaged installation are dependent on the Linux distributions. As an example, Ubuntu distribution requires to run the following commands:
       sudo apt-get install libjpeg62-dev    sudo apt-get install libpng12-dev    
  2. Complete the installation (see below).

Mac OS X platform 10.5 (Leopard) and 10.6 (Snow Leopard)

  1. Follow the same steps outlined above except that you do not need to follow Step 4 to install libwebp.
  2. Install the JPEG and PNG dependencies:
        sudo port install libjpeg libpng    
  3. Complete the installation (see below).

Cygwin platform

  1. Download setup.exe from the Cygwin web page.
  2. Run setup.exe and proceed through the installation.
  3. At the Select Packages screen, add to the pre-selected packages the following:
    • libjpeg-devel, libpng12-devel and libpng14-devel
    • gcc, make and automake (for building packages)
  4. Complete the installation (see below).

Building the WebP from source on Unix platforms

  1. Download libwebp-0.1.2.tar.gz from the downloads list.
  2. Untar or unzip the package. This creates a directory libwebp-0.1.2/:
          tar xvzf libwebp-0.1.2.tar.gz    
  3. Build WebP encoder cwebp and decoder dwebp:
    Go to the libwebp/ directory and run the following commands:
          cd libwebp    ./autogen.sh    ./configure    make    sudo make install    备注:运行./autogen.sh报错,则先运行yum -y install automake libtool    

    This builds and installs the cwebp & dwebp command line tools, along with the libwebp libraries (dynamic and static).

    These tools are usually installed under /usr/local/bin/ by default. The local version are built under the examples/ directory.

    The library will usually be installed under the /usr/local/lib/ directory. To avoid run-time errors, make sure that your LD_LIBRARY_PATH environment variable includes this location. The C headers are typically installed under /usr/local/include/webp.