FAX2TIFF(1) FAX2TIFF(1) NAME fax2tiff−createaTIFFClassFfaxfilefromrawfaxdata SYNOPSIS fax2tiff[options][−ooutput.tif]input.g3 DESCRIPTION Fax2tiffcreatesaTIFFfilecontainingCCITTGroup3orGroup4encodeddatafromoneormore filescontaining‘‘raw’’Group3encodeddata(typicallyobtaineddirectlyfromafaxmodem).By default,eachrowofdataintheresultantTIFFfileis2-dimensionallyencodedandpaddedortrun-catedto1728pixels,asneeded.Theresultantimageisasetoflowresolution(98lines/inch)or mediumresolution(196lines/inch)pages,eachofwhichisasinglestripofdata.Thegenerated fileconformstotheTIFFClassF(FAX)specificationforstoringfacsimiledata.Thismeans,in particular,thateachpageofthedatadoesnotincludethetrailingreturntocontrol(RTC)code; asrequiredfortransmissionbytheCCITTGroup3specifications.Theold,‘‘classic’’,formatis createdifthe−coptionisused.(TheClassFformatcanalsoberequestedwiththe−foption.) Thedefaultnameoftheoutputimageisfax.tif;thiscanbechangedwiththe−ooption.Each inputfileisassumedtobeaseparatepageoffacsimiledatafromthesamedocument.Theorder inwhichinputfilesarespecifiedonthecommandlineistheorderinwhichtheresultantpages appearintheoutputfile. OPTIONS Optionsthataffecttheinterpretationofinputdataare: −2Assumeinputdatais2-dHuffmanencoded. −BAssumeinputdatawasencodedwithblackas0andwhiteas1. −LTreatinputdataashavingbitsfilledfromleastsignificantbit(LSB)tomostsignificant bit(MSB).(Thisisthedefault.) −MTreatinputdataashavingbitsfilledfrommostsignificantbit(MSB)tomostleastbit (LSB). −RSpecifytheverticalresolution,inlines/inch,oftheinputimages.Bydefaultinputare assumedtohaveaverticalresolutionof196lines/inch.Ifimagesarelowresolutionfacsimile,avalueof98lines/inchshouldbespecified. −WAssumeinputdatawasencodedwithblackas1andwhiteas0.(Thisisthedefault.) Optionsthataffecttheoutputfileformatare: −1Forceoutputtobecompressedwiththe1-dimensionalversionoftheCCITTGroup3 Huffmanencodingalgorithm. −4ForceoutputtobecompressedwiththeCCITTGroup4Huffmanencoding. −oSpecifythenameoftheoutputfile. −pForcethelastbitofeachEndOfLine(EOL)codetolandonabyteboundary.This ‘‘zeropadding’’willbereflectedinthecontentsoftheGroup3Optionstagoftheresultant TIFFfile. −sStretchtheinputimageverticallybywritingeachinputrowofdatatwicetotheoutput file. −vForcefax2tifftoprintthenumberofrowsofdataitretrievedfromtheinputfile. DIAGNOSTICS Thefollowingwarningsanderrorscomefromthedecodingroutinesinthelibrary. Warning,%s:PrematureEOLatscanline%d(x%d).\n.Theinputdatahadarowthat wasshorterthantheexpectedvalueof1728.Therowispaddedwithwhite. %s:PrematureEOFatscanline%d(x%d).\n.Thedecoderranoutofdatainthemiddle ofascanline.Theresultantrowispaddedwithwhite. September24,1994 1 FAX2TIFF(1) FAX2TIFF(1) %s:Badcodewordatrow%d,x%d\n.AninvalidGroup3codewasencounteredwhile decodingtheinputfile.Therownumberandhorizontalpositionisgiven.Theremainderofthe inputrowisdiscarded,whilethecorrespondingoutputrowispaddedwithwhite. %s:Bad2Dcodewordatscanline%d.\n.AninvalidGroup4or2DGroup3codewas encounteredwhiledecodingtheinputfile.Therownumberandhorizontalpositionisgiven.The remainderoftheinputrowisdiscarded,whilethecorrespondingoutputrowispaddedwithwhite. BUGS Shouldnothavetheconstantwidth1728builtintoit.Inputdataareassumedtohaveaa‘‘top left’’orientation;itshouldbepossibletooverridethisassumptionfromthecommandline. SEEALSO CCITTRecommendationT.4(StandardizationofGroup3FacsimileApparatusforDocument Transmission). TheSpiritofTIFFClassF,anappendixtotheTIFF5.0specificationpreparedbyCygnetTechnologies. tiffinfo(1),tiffdither(1),tiffgt(1),libtiff(3). September24,1994 2