#include <stdio.h>
#include <string.h>
#include "tiff.c"
#define MAXSIZE 9000000 //this may need increasing for large images

char buffer[MAXSIZE], rbuffer[MAXSIZE];
char from_str[65], to_str[65];
int width, length, from, to ;
char newfname[100];

int main (int argc,char** argv) {

	memset(buffer,0,MAXSIZE);
	memset(rbuffer,0,MAXSIZE);
	strncpy(newfname,argv[1],65);
	sprintf(newfname, "%s.rotated.tif", newfname, from);
	tiff_read (&width, &length, argv[1], buffer); 
	tiff_rotate_ccw (width, length, buffer, rbuffer);
	tiff_write (length, width, newfname, rbuffer);
}
