/* Sampe code uses JPEG and TIFF library. This program reads a tiff image, processes it and output to a jpeg image. It is tested on Linux 2.4. To compile: gcc -o tiff2jpeg tiff2jpeg.c -ljpeg -ltiff -lm JPEG library can be obtained from http://www.ijg.org TIFF library can be obtained from http://www.libtiff.org */ #include #include "tiffio.h" #include "jpeglib.h" unsigned char **cpicalloc(int row, int col) { int i; unsigned char **p; p = (unsigned char **) calloc(row,sizeof(unsigned char *)); if(!p){ fprintf(stderr,"memory allocation error\n"); exit(1); } for(i=0;i