CSUF LogoCSUF Site Navigation
optics.csufresno.edu

F8 Drawing & Image Manipulation Programs xv

Department of Electrical and Computer Engineering
Assistant Professor Gregory R. Kriehn
Forums
Wiki
F8 xv

I can tell that I am starting to become a bit dated in my preferences, because one of my favorite image displays for the X window system, xv, needed some serious hacking in order to get it to compile properly in Fedora 8. I use it because it is simple, easy to use, and allows me to very quickly display, convert, and save different types of image formats. Call me old school, especially with this program, but I love it...

To get xv working, there were a bunch of patches that needed to be applied, since the maintainer preferred throwing up links to patches opposed to applying them to the source code and releasing a new version. As a result, I have decided to apply all of the relevant patches to xv-3.10a for Linux and release an unofficial new version, called xv-3.10p (for patched).

I have also spent considerable time cleaning up the Makefile so that xv now natively looks in the appropriate directories for the JPEG, PNG, ZLIB, TIFF, and JASPER (JPEG 2000) libraries under Fedora 8 (in prior versions of Fedora, I always installed a local version of the JPEG and TIFF libraries due to my lack of understanding about static versus shared libraries
— this has now been rectified). The Makefile also compiles everything a bit more cleanly, and gcc34 (Gnu C Compiler Version 3.4) is NO LONGER REQUIRED to successfully compile xv itself! Unfortunately, xv still does not have a configure script, meaning that things are still likely to break in the future.

Many thanks go to Greg Roelofs, who was responsible for developing his "Jumbo Patch", which is what this version of
xv is based upon. Information about his patch can be found at:

http://pobox.com/~newt/greg_xv.html

Here is a summary of the CHANGELOG for xv-3.10p:


XV 3.10p bug-fix + jumbo patch 12/15/07
-----------------------------------------------
Dr. Gregory R. Kriehn (Professor Kriehn) gkriehn@csufresno.edu

Created a new version of XV, based upon:

        http://pobox.com/~newt/greg_xv.html

Applied the following patches:
   xv03.10a-jumbo-fix-enh-patch-20070520.txt
     (Renamed to: jumbo-patch-20070520.txt)

The patch incorporates ALL of those listed on in the 12/08/07 CHANGELOG,
including those listed under the "Patches *NOT* Applied" section (aside
from installing the jpeg and tiff libraries, which again, are already
installed in Fedora).  In other words, it incorporates all of the
patches available from John's XV site:

        http://www.trilon.com/xv/downloads.html
        ftp://ftp.trilon.com/pub/xv/patches/

The patch also incorporates additional bug-fixes and enhancements from
Greg Roelofs.  One of the biggest changes is that XV now supports use of
the JASPER library.  See README.jumbo for details.

Note:  There are massive changes to config.h.  gunzip, bzip2, and
ghostscript support are enabled by default, in addition to a number of
other options.

All patches are located in the ./xv-3.10p/patches subdirectory.  They
have *already* been applied.

Edited:  CHANGELOG to reflect this information.

Edited:  Makefile to allow XV to compile properly on Fedora 8.

A few notes:
   Everything is still hardwired into the Makefile -- this is still bad.
   Shared libraries are used instead of static libraries.
   XV now compiles with the current version of gcc, not gcc34. Yeah!

Deleted: 
             jpeg subdirectory (obsolete)
             tiff subdirectory (obsolete)

TODO:
   1. Create a configure file, which should lead to a better Makefile.
   2. Re-license XV under the GPL?

Item 1 has a steep learning curve.  Don't expect changes anytime soon.

                                                                  -- Prof. Kriehn


XV 3.10p bug-fix + patches 12/08/07
------------------------------------
Dr. Gregory R. Kriehn (Professor Kriehn) gkriehn@csufresno.edu

Applied the following patches:
   grabpatch
   mp-tiff-patch
   longname.patch
   xpm.patch
   deepcolor.patch
   gifpatch
   exceed_grab.patch
   xv-redhat6-readme.txt (Extracted relevant information)
   tiff1200.patch
   gssafer.patch
   xv-3.10a.JPEG-patch
   xv-3.10a.TIFF-patch
   xv-3.10a-png-1.2d.tar.gz
   xvpng-1.2d-fix3.patch
   pdf.patch
   windowid.patch
   bmp32.patch

Patches *NOT* Applied:
   vispatch (Sun OS only)
   beos.patch (BeOS only)
   jpegsrc.v6b.tar.gz (Already in Fedora)
   tiff-v3.4-tar.gz (Already in Fedora)

All patches are located in the ./xv-3.10p/patches and ./xv-3.10p/png
subdirectories.  They have *already* been applied.

Edited: config.h to include gunzip and ghostscript support.

Edited: Makefile (heavily!) to allow xv to properly compile on Fedora 8.

A few of notes:
   Everything is hardwired into the Makefile -- this is bad.
     One day I need to learn how to make a proper Makefile...
        ...expect things to break in the future.
   Shared libraries are now used instead of static libraries.
   xv will only compile using gcc34 -- a lot of code cleanup
        needs to take place... ...oneday.
   To create a proper rpm, I had to pass the "-Xlinker -shared-libgcc"
        to get around the new "No Build ID" problem in F8.  For details:

        https://www.redhat.com/archives/fedora-maintainers/2007-August/msg00135.html
        http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html

   gcc (not gcc34) is being used to compile the other miscellaneous
        binaries (bggen, vdcomp, xcmap, xvpictoppm).

Deleted:
        Makefile.std (irrelevant)
        jpeg subdirectory (obsolete)
        tiff subdirectory (obsolete)

TODO:
  1.  Create a configure file, which should lead to a better Makefile.
  2.  Need to clean code to bring it up to current gcc standards.
  3.  Re-license xv?

Items 1 - 2 have a steep learning curve ahead for me.  Don't expect
changes anytime soon.
                                                                  -- Prof. Kriehn


What is the upshot of all this? With some serious hacking and learning, I have finally created a new RPM for xv that uses the current, shared libraries in Fedora 8, compiles cleanly on Linux, supports gunzip, bunzip, and ghostscript, and automatically takes care of all of the dependencies. The RPM is available for download (including the source RPM) via the kriehn repository.

To install xv, use yum:
~> sudo yum install xv
Hit Enter and press 'y' when asked if you wish to install the package, along with any dependencies.

If all is well, xv will now be installed, along with any missing libraries that it requires.  yum is a very good thing.


With that done, source your .bashrc file:
~> source ~/.bashrc
and you are ready to use xv:
~> xv &
You now have a nifty little program that can be used to look at, save, and convert gif, jpeg, tiff, png, postscript, pbm/pgm/ppm, X11 bitmap, xpm, bmp, sun rasterfile, IRIS rgb, targa, fits, and pm picture files. For quick and dirty work, I still find it to be the simplest program out there. Enjoy!