Using JPEG library to read/write images on Linux - instruction and sample programs:
  1. Download JPEG library from http://www.ijg.org and build on your system.
  2. Download jpeg2jpeg.c, testimg.jpg and follow the instruction in jpeg2jpeg.c to compile and run the program.