<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY libjpeg-download-http "&sourceforge-repo;/libjpeg-turbo/libjpeg-turbo-&libjpeg-turbo-version;.tar.gz">
  <!ENTITY libjpeg-download-ftp  " ">
  <!ENTITY libjpeg-md5sum        "039153dabe61e1ac8d9323b5522b56b0">
  <!ENTITY libjpeg-size          "1.5 MB">
  <!ENTITY libjpeg-buildsize     "15 MB">
  <!ENTITY libjpeg-time          "0.4 SBU (additional 0.2 SBU for the tests)">
]>

<sect1 id="libjpeg" xreflabel="libjpeg-turbo-&libjpeg-turbo-version;">
  <?dbhtml filename="libjpeg.html"?>

  <sect1info>
  <othername>$LastChangedBy: bdubbs $</othername>
  <date>$Date: 2015-02-20 22:16:55 -0500 (Fri, 20 Feb 2015) $</date>
  </sect1info>

  <title>libjpeg-turbo-&libjpeg-turbo-version;</title>

  <indexterm zone="libjpeg">
    <primary sortas="a-libjpeg-turbo">libjpeg-turbo</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to libjpeg-turbo</title>

    <para>
      <application>libjpeg-turbo</application> is a fork of the original
      IJG <application>libjpeg</application> which uses SIMD to accelerate
      baseline JPEG compression and decompression.
      <application>libjpeg</application> is a library that implements JPEG
      image encoding, decoding and transcoding.
    </para>

    &lfs77_checked;

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>
          Download (HTTP): <ulink url="&libjpeg-download-http;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download (FTP): <ulink url="&libjpeg-download-ftp;"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Download MD5 sum: &libjpeg-md5sum;
        </para>
      </listitem>
      <listitem>
        <para>
          Download size: &libjpeg-size;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated disk space required: &libjpeg-buildsize;
        </para>
      </listitem>
      <listitem>
        <para>
          Estimated build time: &libjpeg-time;
        </para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">libjpeg-turbo Dependencies</bridgehead>

    <bridgehead renderas="sect4">Required</bridgehead>
    <para role="required">
      <xref linkend="nasm"/> or <xref linkend="yasm"/>
    </para>

    <para condition="html" role="usernotes">User Notes:
      <ulink url="&blfs-wiki;/libjpeg-turbo"/>
    </para>
  </sect2>

  <sect2 role="installation">
    <title>Installation of libjpeg-turbo</title>

    <para>
      Install <application>libjpeg-turbo</application> by running the
      following commands:
    </para>

<screen><userinput>sed -i -e '/^docdir/     s:$:/libjpeg-turbo-&libjpeg-turbo-version;:' \
       -e '/^exampledir/ s:$:/libjpeg-turbo-&libjpeg-turbo-version;:' Makefile.in &amp;&amp;

./configure --prefix=/usr           \
            --mandir=/usr/share/man \
            --with-jpeg8            \
            --disable-static &amp;&amp;
make</userinput></screen>

    <para>
      To test the results, issue: <command>make test</command>.
    </para>

    <note><para>
      If installing <application>libjpeg-turbo</application> over an older jpeg
      installation, not all library symbolic links are updated properly.  To fix
      this before installation, run the following as the <systemitem
      class="username">root</systemitem> user:</para>

<screen role="root"><userinput>rm -f /usr/lib/libjpeg.so*</userinput></screen>

    </note>

    <para>
      Now, as the <systemitem class="username">root</systemitem> user:
    </para>

<screen role="root"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <para>
      <command>sed -i -e ...</command> This command fixes Makefile.in to install
      documentation and examples in a version specific directory.
    </para>

    <para>
      <parameter>--with-jpeg8</parameter>: This switch enables compatibility
      with <application>libjpeg</application> version 8.
    </para>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
      href="../../xincludes/static-libraries.xml"/>

  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Programs</segtitle>
      <segtitle>Installed Libraries</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>
          cjpeg, djpeg, jpegtran, rdjpgcom, tjbench, and wrjpgcom
        </seg>
        <seg>
          libjpeg.so and libturbojpeg.so
        </seg>
        <seg>
          /usr/share/doc/libjpeg-turbo-&libjpeg-turbo-version;
        </seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="cjpeg">
        <term><command>cjpeg</command></term>
        <listitem>
          <para>compresses image files to produce a JPEG/JFIF file on the
          standard output. Currently supported input file formats are: PPM
          (PBMPLUS color format), PGM (PBMPLUS gray-scale format),
          BMP, and Targa.</para>
          <indexterm zone="libjpeg cjpeg">
            <primary sortas="b-cjpeg">cjpeg</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="djpeg">
        <term><command>djpeg</command></term>
        <listitem>
          <para>decompresses image files from JPEG/JFIF format to either
          PPM (PBMPLUS color format), PGM (PBMPLUS gray-scale format),
          BMP, or Targa format.</para>
          <indexterm zone="libjpeg djpeg">
            <primary sortas="b-djpeg">djpeg</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="jpegtran">
        <term><command>jpegtran</command></term>
        <listitem>
          <para>is used for lossless transformation of JPEG files.</para>
          <indexterm zone="libjpeg jpegtran">
            <primary sortas="b-jpegtran">jpegtran</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="rdjpgcom">
        <term><command>rdjpgcom</command></term>
        <listitem>
          <para>displays text comments from within a JPEG file.</para>
          <indexterm zone="libjpeg rdjpgcom">
            <primary sortas="b-rdjpgcom">rdjpgcom</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tjbench">
        <term><command>tjbench</command></term>
        <listitem>
          <para>is used to benchmark the performance of libjpeg-turbo.</para>
          <indexterm zone="libjpeg tjbench">
            <primary sortas="b-tjbench">tjbench</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="wrjpgcom">
        <term><command>wrjpgcom</command></term>
        <listitem>
          <para>inserts text comments into a JPEG file.</para>
          <indexterm zone="libjpeg wrjpgcom">
            <primary sortas="b-wrjpgcom">wrjpgcom</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libjpeg-lib">
        <term><filename class="libraryfile">libjpeg.so</filename></term>
        <listitem>
          <para>
            contains functions used for reading and writing
            JPEG images.
          </para>
          <indexterm zone="libjpeg libjpeg-lib">
            <primary sortas="c-libjpeg">libjpeg.so</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
