Re: [hylafax-devel] ImageLength missing in recvq TIFF files for interrupted transmission
Brought to you by:
faxguy
From: <pa...@ur...> - 2021-02-11 23:23:04
|
Makes sense. Many thanks Lee! -- Pawel From: Lee Howard <fa...@ho...> Sent: Thursday, February 11, 2021 11:53 PM To: pa...@ur...; hyl...@li... Subject: Re: [hylafax-devel] ImageLength missing in recvq TIFF files for interrupted transmission When HylaFAX answers a call it creates a TIFF file and starts a TIFF directory (page). No data is in it yet. It then starts to write data into the directory as it gets it, and at the end of the communication it write the number of received lines into the directory. If the communication is interrupted after a page is started but before any data is received, then HylaFAX has an empty directory in the TIFF file that it can't easily dispose of without rewriting the TIFF file. This is the condition of your fax000000944.tif file. The proper thing for the TIFF application to do with such a TIFF file is to process the directories that have data and skip or ignore pages that don't. Applications may issue warnings or error messages, but they shouldn't fail to process the directories that have data. Unfortunately, tiff2pdf doesn't process the data that it could. This is a problem with tiff2pdf, and you may get some traction by filing a bug report with them. However, it may just be easier to pre-process the TIFF file before handing it off to tiff2pdf or whatever other application you may be using: tiffcp -i fax000000944.tif fax000000944-new.tif ... then work with the "new" file. This will solve a lot of ills related to this condition as well as other tricky situations (like a non-ECM fax receiving corrupt MH/MR data from the sender). This can be done within the faxrcvd, FaxAccounting, or FaxDispatch scripts as may suit your situation best. One might say that HylaFAX should only produce perfectly clean TIFF files as output. I can understand that perspective... I certainly sympathize with it (as I have to use the same tiffcp for all of the faxes that I receive). However, historically HylaFAX was designed to have the TIFF file honestly reflect the fax communication as best as possible... so by default data isn't being altered in the TIFF file from what was sent by the sender. This may or may not make practical sense, but it's the design that HylaFAX has had since the beginning. In some forensic or diagnostic sense the "raw" state of the TIFF files is sometimes helpful, though. Thanks, Lee. On 02/10/2021 02:28 PM, pa...@ur... <mailto:pa...@ur...> wrote: Hello, When the inbound fax transmission is interrupted, the tiff file generated in the recvq directory is missing the ImageLength field. Some apps using libtiff have issues with these files. For example, tiff2pdf: [root@hylafax tmp]# tiff2pdf -p A4 -o 944.pdf fax000000944.tif MissingRequired: TIFF directory is missing required "ImageLength" field. tiff2pdf: Can't set directory 3 of input file fax000000944.tif. tiff2pdf: An error occurred creating output PDF file Example tiff file (zipped) - 3 pages, the last one was interrupted: https://drive.google.com/file/d/16edQY9NZkq5mNNALqEyx6TARefwa3GlH/view?usp=s haring Hylafax+ 7.0.3 CentOS 7(2009) -- Pawel |