2019.04.02 09:54 "[Tiff] TIFFWriteEncodedStrip is resulting in error.", by Ganesh Bondili

2019.04.04 12:32 "Re: [Tiff] TIFFWriteEncodedStrip is resulting in error.", by Kemp Watson

Maybe buy more RAM? Or, you will need to recode to use less memory, or write in strips. You are allocating over 1.5 GB of RAM just for the output buffer.

[signature_1717328940]

W. Kemp Watson
+1 (416) 970-7284
Objective Pathology Services Limited
13629 Fallbrook Trail, Halton Hills
Ontario, Canada L7G 4S8

Subject: RE: [Tiff] TIFFWriteEncodedStrip is resulting in error.

I am getting below error details after using - TIFFSetErrorHandler. Can this issue be resolved by other means.

"%s: No space for output buffer"

Regards,
Ganesh.

From: Kemp Watson [mailto:kemp@objectivepathology.com]

Sent: Tuesday, April 02, 2019 4:15 PM

To: Ganesh Bondili; tiff@lists.osgeo.org

Subject: Re: [Tiff] TIFFWriteEncodedStrip is resulting in error.

Ganesh:

Did you use TIFFSetErrorHandler to see what the actual issue is?

Also, be aware that XRESOLUTION and YRESOLUTION are floats, not integers.

[signature_1341774294]

W. Kemp Watson
+1 (416) 970-7284
Objective Pathology Services Limited
13629 Fallbrook Trail, Halton Hills
Ontario, Canada L7G 4S8

From: Tiff <tiff-bounces@lists.osgeo.org<mailto:tiff-bounces@lists.osgeo.org>> on behalf of Ganesh Bondili <Ganesh.Bondili@kofax.com<mailto:Ganesh.Bondili@kofax.com>>

Date: Tuesday, April 2, 2019 at 6:06 AM

To: "tiff@lists.osgeo.org<mailto:tiff@lists.osgeo.org>" <tiff@lists.osgeo.org<mailto:tiff@lists.osgeo.org>>

Subject: [Tiff] TIFFWriteEncodedStrip is resulting in error.

Hi LibTIFF,

We have a Customer that has reported that they are unable to convert attached(below link) PDF file(5C826DA7.pdf) from PDF to Tiff and resulting in error. We are using first Datalogics library to load & draw each page from PDF file to memory buffer which we then use LibTIFF library to write to TIFF file as below with given Tags set. In case of resolution ‘TIFFTAG_XRESOLUTION’ set as 300x300, error is generated at ‘TIFFWriteEncodedStrip()’ function with below values. Buffer looks good when saved as BMP file. Same file gets converted successfully for 200x200 resolution.

https://drive.google.com/open?id=1TvF1aj9L9z3ZuHru57ui0k0Cm37F8iO_

What is the reason for error for this PDF file at ‘TIFFWriteEncodedStrip()’ function and can this be resolved and converted to TIFF without error at 300x300 resolution.

                                TIFFSetField(hTIFF, TIFFTAG_IMAGEWIDTH, 24209);
                                TIFFSetField(hTIFF, TIFFTAG_IMAGELENGTH, 22730);
                                TIFFSetField(hTIFF, TIFFTAG_COMPRESSION, 7);
                                TIFFSetField(hTIFF, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB);
                                TIFFSetField(hTIFF, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
                                TIFFSetField(hTIFF, TIFFTAG_XRESOLUTION, 300); // works good for 200
                                TIFFSetField(hTIFF, TIFFTAG_YRESOLUTION, 300); // works good for 200
                                TIFFSetField(hTIFF, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
                                TIFFSetField(hTIFF, TIFFTAG_SOFTWARE, "Conv ");
                                TIFFSetField(hTIFF, TIFFTAG_SAMPLESPERPIXEL, 3);
                                TIFFSetField(hTIFF, TIFFTAG_BITSPERSAMPLE, 8);
                                TIFFSetField(hTIFF, TIFFTAG_PHOTOMETRIC, 2);
                                TIFFSetField(hTIFF, TIFFTAG_JPEGQUALITY, 75);

                                Ret1 = TIFFWriteEncodedStrip(hTIFF, 0, buffer, 1650811710);// Error occurs here - returns '-1' value
                                if (Ret1 != -1) {
                                                Ret2 = TIFFWriteDirectory(hTIFF);
                                }
Regards,
Ganesh.

Ganesh Bondili

Senior Software Enginee