#### Beyond Linux® From Scratch (System V Edition) - Version r12.4-737

### Chapter 10. Graphics and Font Libraries

- Prev

  gegl-0.4.64

- Next

  Glad-2.0.8

- Up
- Home

# giflib-5.2.2

## Introduction to giflib

The giflib package contains libraries for reading and writing GIFs as well as programs for converting and working with GIF files.

### Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

### Package Information

- Download (HTTP): https://sourceforge.net/projects/giflib/files/giflib-5.2.2.tar.gz

- Download MD5 sum: 913dd251492134e235ee3c9a91987a4d

- Download size: 440 KB

- Estimated disk space required: 4.0 MB (with documentation)

- Estimated build time: less than 0.1 SBU (with documentation)

### Additional Downloads

- Required patch: https://www.linuxfromscratch.org/patches/blfs/svn/giflib-5.2.2-upstream_fixes-1.patch

- Required patch: https://www.linuxfromscratch.org/patches/blfs/svn/giflib-5.2.2-security_fixes-1.patch

### giflib Dependencies

#### Optional

xmlto-0.0.29 (required if you run make after make clean) [1]

## Installation of giflib

First, prevent the build process from installing XML files instead of man pages:

    patch -Np1 -i ../giflib-5.2.2-upstream_fixes-1.patch

Next, fix several security vulnerabilities in the 'gif2rgb' utility:

    patch -Np1 -i ../giflib-5.2.2-security_fixes-1.patch

Next, remove an unnecessary dependency on ImageMagick-7.1.2-1 by moving a file into an expected location:

    cp pic/gifgrid.gif doc/giflib-logo.gif

Install giflib by running the following commands:

    make

To test the results, issue: make check.

Now, as the `root` user:

    make PREFIX=/usr install &&

    rm -fv /usr/lib/libgif.a &&

    find doc \( -name Makefile\* -o -name \*.1 \
             -o -name \*.xml \) -exec rm -v {} \; &&

    install -v -dm755 /usr/share/doc/giflib-5.2.2 &&
    cp -v -R doc/* /usr/share/doc/giflib-5.2.2

## Command Explanations

rm -fv /usr/lib/libgif.a: This command removes a static library which is not used by any BLFS package.

find doc ... -exec rm -v {} \;: This command removes `Makefiles`, man and xml files from the documentation directory that would otherwise be installed by the commands that follow.

## Contents

Installed Programs: gif2rgb, gifbuild, gifclrmp, giffix, giftext, and giftool
Installed Library: libgif.so
Installed Directory: /usr/share/doc/giflib-5.2.2

### Short Descriptions

gif2rgb | converts images saved as GIF to 24-bit RGB images
gifbuild | dumps GIF data in a textual format, or undumps it to a GIF
gifclrmp | modifies GIF image colormaps
giffix | clumsily attempts to fix truncated GIF images
giftext | prints (text only) general information about a GIF file
giftool | is a GIF transformation tool
`libgif.so` | contains API functions required by the giflib programs and any other programs needing library functionality to read, write and manipulate GIF images

[1] Pre-built documentation is present in this tarball. make will detect that documentation already exists in the distribution if make clean was not run, and will not require the xmlto-0.0.29 dependency. However, running make clean will result in the pre-built documentation being deleted, thus requiring xmlto to build the documentation if make is run afterwards.

- Prev

  gegl-0.4.64

- Next

  Glad-2.0.8

- Up
- Home