yob/pdf-reader — pull request #60 by ikohara (2012-07-22 06:45:49+00:00)
Title: add next IDF pointer after last IFD entry

I fixed TIFF header generation bug at example/extract_images.rb.
It lacked next IFD pointers (see Figure 1 in http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf ).
Please review.

Test commands and results:

$ cd pdf-reader/example
$ git checkout master
$ convert logo: -threshold 50% -type Bilevel ppm:- | sam2p -c:g4 -pdf:2 - ../spec/data/adobe_sample.pdf
$ ruby -I../lib extract_images.rb
$ identify 1-1-S.tif

1-1-S.tif TIFF 640x480 640x480+0+0 1-bit DirectClass 1.9KB 0.000u 0:00.010
identify.im6: 1-1-S.tif: Can not read TIFF directory count. `TIFFFetchDirectory' @ error/tiff.c/TIFFErrors/508.
identify.im6: 1-1-S.tif: Failed to read directory at offset 0. `TIFFReadDirectory' @ error/tiff.c/TIFFErrors/508.

$ git checkout work
$ ruby -I../lib extract_images.rb
$ identify 1-1-S.tif

1-1-S.tif TIFF 640x480 640x480+0+0 1-bit DirectClass 1.9KB 0.000u 0:00.010