TIFF Driver (gdevtifs.c) In generated TIFF's the PageCount is alway 0 (zero) in pair (PageNumber,PageCount) Properties obtained with HIJAAK software from tiff file with five pages, see tag 297: ------------------------------------------------------------------------ Intel type current IFD at: 8 number of tags in current IFD: 20 NewSubFileType tag: 254 type: 4 count: 1 data: 2 width tag: 256 type: 4 count: 1 data: 1728 height tag: 257 type: 4 count: 1 data: 2292 BitsPerSample tag: 258 type: 3 count: 1 data: 1 Compression tag: 259 type: 3 count: 1 data: 4 PhotoInterp tag: 262 type: 3 count: 1 data: 0 fillOrder tag: 266 type: 3 count: 1 data: 1 stripOffsets tag: 273 type: 4 count: 1 data: 338 orientation tag: 274 type: 3 count: 1 data: 1 SamplesPerPixel tag: 277 type: 3 count: 1 data: 1 RowsPerStrip tag: 278 type: 4 count: 1 data: 2292 StripByteCounts tag: 279 type: 4 count: 1 data: 2473 XResolution tag: 282 type: 5 count: 1 data: 204 1 YResolution tag: 283 type: 5 count: 1 data: 196 1 PlanarConfig tag: 284 type: 3 count: 1 data: 1 Group4Options tag: 293 type: 4 count: 1 data: 0 ResolutionUnit tag: 296 type: 3 count: 1 data: 2 PageNumber tag: 297 type: 3 count: 2 data: 0 0 software tag: 305 type: 2 count: 21 data: GPL Ghostscript 8.54 dateTime tag: 306 type: 2 count: 20 data: 2000:01:01 23:37:39 Intel type current IFD at: 2812 number of tags in current IFD: 20 NewSubFileType tag: 254 type: 4 count: 1 data: 2 width tag: 256 type: 4 count: 1 data: 1728 height tag: 257 type: 4 count: 1 data: 2292 BitsPerSample tag: 258 type: 3 count: 1 data: 1 Compression tag: 259 type: 3 count: 1 data: 4 PhotoInterp tag: 262 type: 3 count: 1 data: 0 fillOrder tag: 266 type: 3 count: 1 data: 1 stripOffsets tag: 273 type: 4 count: 1 data: 3142 orientation tag: 274 type: 3 count: 1 data: 1 SamplesPerPixel tag: 277 type: 3 count: 1 data: 1 RowsPerStrip tag: 278 type: 4 count: 1 data: 2292 StripByteCounts tag: 279 type: 4 count: 1 data: 2498 XResolution tag: 282 type: 5 count: 1 data: 204 1 YResolution tag: 283 type: 5 count: 1 data: 196 1 PlanarConfig tag: 284 type: 3 count: 1 data: 1 Group4Options tag: 293 type: 4 count: 1 data: 0 ResolutionUnit tag: 296 type: 3 count: 1 data: 2 PageNumber tag: 297 type: 3 count: 2 data: 1 0 software tag: 305 type: 2 count: 21 data: GPL Ghostscript 8.54 dateTime tag: 306 type: 2 count: 20 data: 2000:01:01 23:37:39 Intel type current IFD at: 5640 number of tags in current IFD: 20 NewSubFileType tag: 254 type: 4 count: 1 data: 2 width tag: 256 type: 4 count: 1 data: 1728 height tag: 257 type: 4 count: 1 data: 2292 BitsPerSample tag: 258 type: 3 count: 1 data: 1 Compression tag: 259 type: 3 count: 1 data: 4 PhotoInterp tag: 262 type: 3 count: 1 data: 0 fillOrder tag: 266 type: 3 count: 1 data: 1 stripOffsets tag: 273 type: 4 count: 1 data: 5970 orientation tag: 274 type: 3 count: 1 data: 1 SamplesPerPixel tag: 277 type: 3 count: 1 data: 1 RowsPerStrip tag: 278 type: 4 count: 1 data: 2292 StripByteCounts tag: 279 type: 4 count: 1 data: 2503 XResolution tag: 282 type: 5 count: 1 data: 204 1 YResolution tag: 283 type: 5 count: 1 data: 196 1 PlanarConfig tag: 284 type: 3 count: 1 data: 1 Group4Options tag: 293 type: 4 count: 1 data: 0 ResolutionUnit tag: 296 type: 3 count: 1 data: 2 PageNumber tag: 297 type: 3 count: 2 data: 2 0 software tag: 305 type: 2 count: 21 data: GPL Ghostscript 8.54 dateTime tag: 306 type: 2 count: 20 data: 2000:01:01 23:37:39 Intel type current IFD at: 8474 number of tags in current IFD: 20 NewSubFileType tag: 254 type: 4 count: 1 data: 2 width tag: 256 type: 4 count: 1 data: 1728 height tag: 257 type: 4 count: 1 data: 2292 BitsPerSample tag: 258 type: 3 count: 1 data: 1 Compression tag: 259 type: 3 count: 1 data: 4 PhotoInterp tag: 262 type: 3 count: 1 data: 0 fillOrder tag: 266 type: 3 count: 1 data: 1 stripOffsets tag: 273 type: 4 count: 1 data: 8804 orientation tag: 274 type: 3 count: 1 data: 1 SamplesPerPixel tag: 277 type: 3 count: 1 data: 1 RowsPerStrip tag: 278 type: 4 count: 1 data: 2292 StripByteCounts tag: 279 type: 4 count: 1 data: 2486 XResolution tag: 282 type: 5 count: 1 data: 204 1 YResolution tag: 283 type: 5 count: 1 data: 196 1 PlanarConfig tag: 284 type: 3 count: 1 data: 1 Group4Options tag: 293 type: 4 count: 1 data: 0 ResolutionUnit tag: 296 type: 3 count: 1 data: 2 PageNumber tag: 297 type: 3 count: 2 data: 3 0 software tag: 305 type: 2 count: 21 data: GPL Ghostscript 8.54 dateTime tag: 306 type: 2 count: 20 data: 2000:01:01 23:37:39 Intel type current IFD at: 11290 number of tags in current IFD: 20 NewSubFileType tag: 254 type: 4 count: 1 data: 2 width tag: 256 type: 4 count: 1 data: 1728 height tag: 257 type: 4 count: 1 data: 2292 BitsPerSample tag: 258 type: 3 count: 1 data: 1 Compression tag: 259 type: 3 count: 1 data: 4 PhotoInterp tag: 262 type: 3 count: 1 data: 0 fillOrder tag: 266 type: 3 count: 1 data: 1 stripOffsets tag: 273 type: 4 count: 1 data: 11620 orientation tag: 274 type: 3 count: 1 data: 1 SamplesPerPixel tag: 277 type: 3 count: 1 data: 1 RowsPerStrip tag: 278 type: 4 count: 1 data: 2292 StripByteCounts tag: 279 type: 4 count: 1 data: 2497 XResolution tag: 282 type: 5 count: 1 data: 204 1 YResolution tag: 283 type: 5 count: 1 data: 196 1 PlanarConfig tag: 284 type: 3 count: 1 data: 1 Group4Options tag: 293 type: 4 count: 1 data: 0 ResolutionUnit tag: 296 type: 3 count: 1 data: 2 PageNumber tag: 297 type: 3 count: 2 data: 4 0 software tag: 305 type: 2 count: 21 data: GPL Ghostscript 8.54 dateTime tag: 306 type: 2 count: 20 data: 2000:01:01 23:37:39
Thank you for using and testing Ghostscript. Accerding to the TIFF 6 spec, if PageNumber[1] is 0, the total number of pages in the document is not available. Ghostscript cannot determine the number of pages in the PostScript file before finishing the file. Patching the TIFF file at the end is not always possible - the output device may not be seekable. The TIFF file doesn't violate the spec, and improvements are difficult (or impossible) to implement. Closing the bug report as "won't fix".
Ghostscript has a new TIFF device based on libtiff but all statements from the comment #1 still hold. Besides, there were no other requests to add a total number of pages to the generated tiff.