Hi Ganesh
I tested with convert.exe (Version: ImageMagick 6.9.10-60 Q16 x64 2019-08-10) and found no issues. Both files were converted to PDF successfully. I also tried with tiffcp.exe from LibTiff version 4.5.0: tiffcp test.tiff test_out.tiff reports the error for the last page (6/6): Fax3Decode1D: Buffer overflow at line 2253 of strip 0. test.tiff: Error, can't read strip 0. This means, that there is probably an encoding error in the CCITT T.4 encoded data or at least an encoding case, which is not handled for decoding. The error message "Buffer overflow .." comes just from a check in tif_fax3.c to avoid possible buffer overflows. Since I'm not an expert in fax coding, I can't help further. Again, even when TIFFReadRawStrip() does not report any errors, it is not guaranteed that you get what you expect, especially when you read encoded data. TIFFReadRawStrip() reads the raw data with the assumption that the data are NOT encoded. By the way, tiffcp.exe uses TIFFReadEncodedStrip() and TIFFWriteEncodedStrip() for test.tiff above. Regards Su Von: Ganesh Bondili [mailto:ganesh.bond...@kofax.com] Gesendet: Dienstag, 2. Mai 2023 21:02 An: Sulau <su...@freenet.de> Cc: tiff@lists.osgeo.org Betreff: RE: [Tiff] [EXTERNAL] Re: Specific image fails with error at TIFFWriteRawStrip function(26659675) Hi Su, I have modified sample as you have given by adding mandatory tags. I have attached complete sample in the below link. I could not see error at "TIFFReadRawStrip ()" but TIFFWriteRawStrip()' results in error "Maximum TIFF file size exceeded". 'TIFFWriteEncodedStrip()' throws error "Fractional scanlines cannot be written". How these errors can be resolved. https://drive.google.com/file/d/1JGPBGCkYAdRFUfUAa2K2DSF_H8e3Hvxn/view?usp=s hare_link I have also tested with ImageMagick with customer 'Test.Tiff' & our own G3 (CCITT T.4) sample attached '3pg_small.tif'. ImageMagick Convert.exe has resulted in error as below with Customer Sample 'Test.Tiff' but not with our G3 (CCITT T.4) sample '3pg_small.tif' as shown below. Why ImageMagick throws error ": Buffer overflow at line 2253" for customer sample only. Why conversion works with our G3 (CCITT T.4) sample but not with the sample from the customer 'Test.Tiff'. ImageMagick Convert.exe execution - C:\Program Files (x86)\ImageMagick>convert test.tiff tt1.pdf convert: Buffer overflow at line 2253 of strip 0. `Fax3Decode1D' @ error/tiff.c/TIFFErrors/600. C:\Program Files (x86)\ImageMagick64>convert 3pg_small.tif TT2.pdf No error. Successful conversion. Regards, Ganesh. Ganesh Bondili Principal Software Engineer Kofax India Private Limited V IT Park, Capella Building, Floor 6, Plot No. 17, Software Units Layout Hyderabad, Madhapur 500081 India Tel: +91 40 45459949 Fax: +91 40 45459922 ganesh.bond...@kofax.com <mailto:ganesh.bond...@kofax.com> . ____________________________________________________________________________ ____________________________________________________________________________ ______ This communication is only for the use of the intended recipient. It may contain confidential or proprietary information. If you are not the intended recipient or have received this communication in error, please notify the sender via phone and destroy this communication immediately. From: Sulau <su...@freenet.de <mailto:su...@freenet.de> > Sent: Friday, April 21, 2023 7:32 PM To: Ganesh Bondili <ganesh.bond...@kofax.com <mailto:ganesh.bond...@kofax.com> > Cc: tiff@lists.osgeo.org <mailto:tiff@lists.osgeo.org> Subject: AW: [Tiff] [EXTERNAL] Re: Specific image fails with error at TIFFWriteRawStrip function(26659675) Hi Ganesh With the testfile LibTIFFCrsh1.cpp I get the error message: "TIFFWriteRawStrip: Must set "ImageWidth" before writing data." That is, you can't just create a default TIFF directory (out = TIFFOpen(sInputSinglePage.c_str(), "w");) and then write image data to that directory without first setting up the mandatory tags accordingly. Finally, you have to write the TIFF directory to the file. This is done by TIFFClose(). You should also close the input file at the end. Finally, the input image data are "Group3Fax" compressed. That means the function TIFFReadRawStrip() reads nonsense. You need to read with TIFFReadEncodedStrip(). You should read the TIFF documentation at: http://www.simplesystems.org/libtiff/index.html and get familiar with copying of data using as example: https://gitlab.com/libtiff/libtiff/-/blob/master/tools/tiffcp.c . I would suggest taking tiffcp.c in the debugger and debug how your file is copied there. Another example, how to write a simple TIFF image is given in https://gitlab.com/libtiff/libtiff/-/blob/master/test/custom_dir.c line 63 to 128. Regards Su Von: Tiff [mailto:tiff-boun...@lists.osgeo.org] Im Auftrag von Ganesh Bondili via Tiff Gesendet: Mittwoch, 19. April 2023 20:11 An: Bob Friesenhahn <bfrie...@simple.dallas.tx.us <mailto:bfrie...@simple.dallas.tx.us> > Cc: 'tiff@lists.osgeo.org' <tiff@lists.osgeo.org <mailto:tiff@lists.osgeo.org> > Betreff: Re: [Tiff] [EXTERNAL] Re: Specific image fails with error at TIFFWriteRawStrip function(26659675) Thank you Bob for the information. Does this mean the TIFF internal data is Huge size for example 4GB or more. But the file Test.TIFF itself is just 370 KB. Hi LibTIFF team, Are there any other replies suggesting root-cause for this Test.TIFF error. Is the Test.TIFF is as per TIFF standard. Are there any other problems with this input TIFF or solution to successfully copy/write strips individually to TIFF files. Why is the size of single strip is returned as such a huge size(IS any field has wrong data). Will 64 bit of LibTIFF binaries will resolve this issue is some way. Regards, Ganesh.
_______________________________________________ Tiff mailing list Tiff@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/tiff