Linux tip, Fedora tip / howto: Compiling xv with Progressive JPEG and PNG support

Note that these tips are mostly outdated

back to notes and tips index

Try my online puzzle page with Calcudoku, Killer Sudoku and online Sudoku.

Compiling xv with Progressive JPEG and PNG support

First, a straight install method for CentOS:
  • install the nux dextop repository
  • run yum install xv

compiling it

Written before the web existed, xv is still one of the best image viewing/manipulating programs around. The author still maintains a web site with source and patches at this xv downloads page.

To get it to compile with Progressive JPEG and PNG support was a bit tricky. The instructions below worked on a Fedora Core 4 installation.

  • from the above download page, download xv-3.10a.tar.gz, decompress it with tar zxvf xv-3.10a.tar.gz
  • near the bottom of the page, from the Optional Patches list, download into the xv-3.10a source directory:
    • the Patch to use Version 6 of the JPEG library (xv-3.10a.JPEG-patch)
    • the Patch to read/write PNG files (xv-3.10a-png-1.2d.tar.gz) (including the patch that is mentioned in the text below it (xvpng-1.2d-fix3.patch))
  • get the open source JPEG library from the Independent JPEG Group page, and decompress it in the xv-3.10a directory
  • to make sure the new JPEG library is used:
    rm -rf jpeg
    mv jpeg-6b jpeg
  • for the PNG support:
    yum install libpng-devel
    yum install zlib-devel
  • apply the patches:
    patch < xv-3.10a.JPEG-patch
    tar zxvf xv-3.10a-png-1.2d.tar.gz
    patch -p1 < xvpng.diff
    patch < xvpng-1.2d-fix3.patch
  • open the Makefile in an editor, and change this line:
    LIBS = -L /usr/X11R6/lib -lX11 $(JPEGLIB) $(TIFFLIB) $(PNGLIB) $(ZLIBLIB) -lm
  • run make
  • if you get this error:
    xv.h:119: error: conflicting types for 'sys_errlist'
    simply comment out the offending line in xv.h:
    /* extern char *sys_errlist[]; /* this too... */
  • run make install to install. To create an RPM, use checkinstall

← back to notes and tips index
Please do not copy the text of this tip (© Patrick Min) to your web site.