/* Sampe code uses JPEG and TIFF library. This program reads a jpeg image, processes it and output to a tiff image. It is tested on Linux 2.4. To compile: gcc -o jpeg2tiff jpeg2tiff.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