Bug 2702 - tiff2pdf conversion not working on a multiple page file
: tiff2pdf conversion not working on a multiple page file
Status: RESOLVED LATER
: libtiff
default
: unspecified
: All Linux
: P2 normal
: ---
Assigned To:
:
:
: migrated_to_gitlab
:
:
  Show dependency treegraph
 
Reported: 2017-05-30 04:49 by
Modified: 2019-10-01 14:20 (History)


Attachments
TIF file (121.71 KB, image/tiff)
2017-05-30 04:49, madhulis@opentext.com
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2017-05-30 04:49:20
Created an attachment (id=784) [details]
TIF file

For  20170113091505_4548000_N0001P0001.TIF attached in the mail if we run the
following command segmentation fault is happening

tiff2pdf -o output.pdf 20170113091505_4548000_N0001P0001.TIF

TIFFVSetField: sample.TIF: Bad value 0 for "RowsPerStrip".
tiff2pdf: Can't set directory 3 of input file sample.TIF.
TIFFSetField: Segmentation fault (core dumped)


Attached is the file

If  you can help with this, waiting for your response.

Thanks in advance
------- Comment #1 From 2017-06-01 08:10:13 -------
I can't reproduce any crash with latest CVS head. Works fine with
-fsanitize=undefined,address & Valgrind
------- Comment #2 From 2017-06-01 08:24:15 -------
(In reply to comment #1)
> I can't reproduce any crash with latest CVS head. Works fine with
> -fsanitize=undefined,address & Valgrind

 Hi,
Could you please provide the location of source code on which you are currently
working.

Waiting for response .
Thanks in advance

Regards
Madhulika Singh
------- Comment #3 From 2017-06-01 08:35:03 -------
export CVSROOT=:pserver:cvsanon@cvs.maptools.org:/cvs/maptools/cvsroot
cvs login
(use empty password)
cvs checkout libtiff
------- Comment #4 From 2017-06-02 05:01:44 -------
Hi,

I tried to build the source provided by you in previous mail.
But it is not getting build.My platform details are mentioned below

Linux devoutputserver 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64
x86_64 x86_64 GNU/Linux.

So I downloaded latest official build tiff-4.0.8 and replace the *.c and *.h
with the ones provided by cvs and build it

After building tiff2pdf is not crashing but it is giving error and file is not
getting generated

./tiff2pdf -o output.pdf /home/madhulika/20170113091505_4548000_N0001P0001.TIF
_TIFFVSetField: /home/madhulika/20170113091505_4548000_N0001P0001.TIF: Bad
value 0 for "RowsPerStrip" tag.
tiff2pdf: Can't set directory 3 of input file
/home/madhulika/20170113091505_4548000_N0001P0001.TIF.
tiff2pdf: An error occurred creating output PDF file.

strace output shows

mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2b54da3e5000
lseek(4, 0, SEEK_SET)                   = 0
write(2, "_TIFFVSetField: ", 16_TIFFVSetField: )        = 16
write(2, "/home/madhulika/20170113091505_4"...,
89/home/madhulika/20170113091505_4548000_N0001P0001.TIF: Bad value 0 for
"RowsPerStrip" tag) = 89
write(2, ".\n", 2.
)                      = 2
write(2, "tiff2pdf: ", 10tiff2pdf: )              = 10
write(2, "Can't set directory 3 of input f"..., 89Can't set directory 3 of
input file /home/madhulika/20170113091505_4548000_N0001P0001.TIF) = 89
write(2, ".\n", 2.
)                      = 2
write(2, "tiff2pdf: ", 10tiff2pdf: )              = 10
write(2, "An error occurred creating outpu"..., 42An error occurred creating
output PDF file) = 42
write(2, ".\n", 2.
)                      = 2
munmap(0x2b54da3c6000, 124626)          = 0
close(-4294967293)
------- Comment #5 From 2017-06-02 05:23:20 -------
You must run autogen.sh before configure when working from a CVS checkout.

OK, so this is now just a defect of tiff2pdf not working properly in that case.
Probably linked to the multiple directories in the file
------- Comment #6 From 2017-06-02 05:40:23 -------
Hi,

Could you please ellaborate what is the meaning of multiple directories.

Regards
Madhulika Singh
------- Comment #7 From 2017-06-02 22:35:42 -------
Hi,

Just want to share an observation about the above tif file.
The attached TIF file contain 4 pages but 4th page is also numbered as 03/06
that may be causing error.

Could you please tell me when it is expected to be fixed as customer is blocked
because of this.


Waiting for response.

Thanks in advance

Regards
Madhulika Singh
------- Comment #8 From 2017-06-03 05:39:27 -------
> Just want to share an observation about the above tif file.
> The attached TIF file contain 4 pages but 4th page is also numbered as 03/06
>that may be causing error.

Actually this TIFF file is corrupted. The 4th page has a height of 0 :

Directory 3: offset 124404 (0x1e5f4) next 0 (0)
SubFileType (254) LONG (4) 1<2>
ImageWidth (256) LONG (4) 1<1728>
ImageLength (257) LONG (4) 1<0> <-- wrong

> Could you please tell me when it is expected to be fixed as customer is blocked
because of this.

This bug tracker is the one of the community project driven by volunteers, so
there's no guarantee if and when a bug will be fixed. If your business depends
on libtiff, then consider contracting a developer to fix it.

Regarding this specific issue, the best fix would probably to have a flag to
skip gracefully over corrupted pages.
------- Comment #9 From 2019-10-01 14:20:34 -------
Bugzilla is no longer used for tracking libtiff issues. Remaining open tickets,
such as this one, have been migrated to the libtiff GitLab instance at
https://gitlab.com/libtiff/libtiff/issues .

The migrated tickets have their summary prefixed with [BZ#XXXX] where XXXX is
the initial Bugzilla issue number.