2015.03.10 10:44 "[Tiff] How to convert FAX FILE CCITT3 to TIFF", by pat 000
Before everything, sorry for my poor English (I'm french)...
I have some questions about converting a Fax Raw file CCIITT 3 to TIFF. I must write a programme that convert these files. Before i used the "fax2tiff" program with the following command line: "fax2tiff source -o result.tif -L -1 -R 98". I don't know the differents step to process the conversion. I tried something to begin
Here are my differents steps
- I open the output file in writting mode
- I Set the differents TAG with TIFFSetField Routine for the output file
- TIFFTAG_IMAGEWIDTH = 1728
- TIFFTAG_BITPERSAMPLE = 1
- TIFFTAG_COMPRESSION = COMPRESSION_CCITTFAX3
- TIFFTAG_PHOTOMETRIC = PHOTOMETRIC_MINISWHITE
- TIFFTAG_ORIENTATION = ORIENTATION_TOPLEFT
- TIFFTAG_SAMPLEPERPIXEL = 1
- TIFFTAG_GROUP3OPTIONS = 0
- TIFFTAG_FAXMODE = FAXMODE_CLASSF
- TIFFTAG_ROWSPERSTRIP =
- TIFFTAG_PLANARCONFIG = PLANARCONFIG_CONTIG
- TIFFTAG_FILLORDER = FILLORDER_LSB2MSB
- TIFFTAG_SOFTWARE = "faxConverter"
- TIFFTAG_XRESOLUTION = 204.0
- TIFFTAG_YRESOLUTION = 98.0
- TIFFTAG_RESOLTIONUNIT = RESUNIT_INCH;
3) I open the Input file
FILE * file = fopen("inputfile", "r");
After i don't know how to go on?
I don't know how to read the input file. Must i read the entire file with one read()?
How must i write the data into the output file?