1# Change Log 2 3## [0.36] - 2017-12-27 4### Minor updates, no significant code changes. 5- Minor changes to avoid a few compile warnings. 6- Updates to email address, URL, copyright notices. 7 8## [0.35] - 2016-06-23 9### Added CHANGELOG.md 10 11## [0.34] - 2016-06-23 12### Many fixes and enhancements from Palomar Corporation 13- Modify "bitblt.h" to undefine BITS_PER_WORD, which is defined in the 14 netpbm header "pm_config.h", so that the tumble use takes precedence. 15- Fix a bug in "bitblt_write_g4" (bitblt_g4.c). Tumble would crash in 16 "g4_get_pixel" with bad pointer access when trying to encode a TIFF image 17 that was 14400 x 6100 (24" x 11"). "g4_get_pixel" was called with index 18 14400, which accesses the first byte beyond the allocated array. 19- "bitblt_write_g4" is called to encode and write a TIFF bitmap to the PDF 20 file. It allocates and zeros a temporary buffer to hold a scan line and 21 then calls "g4_encode_row" for each line. "g4_find_pixel" is called to 22 find the first 1 bit in the temporary buffer. Because the buffer has been 23 zeroed, "g4_find_pixel" returned the image width (14400) when the 24 specified pixel could not be found in scan line. A subsequent call to 25 "g4_get_pixel" specified this pixel number (14400), which accessed memory 26 beyond the allocation. 27 28 The crash wasn't repeatable. To occur, the image width had to be a 29 multiple of 32 (else the last pixel + 1 would still be within the final 30 word), and the allocation had to end exactly on a page boundary (so the 31 first byte beyond the allocation was read-protected). 32 33 Fix is to pad the temporary buffer with an extra word if the width is an 34 exact multiple of 32. Note that access beyond the source bitmap is 35 prohibited by the "if (a0 >= width) break;" test prior to the 36 "g4_get_pixel" call. 37 38- Modify the makefile to add PNG and blank-page support files. 39 40- Modify "parser.y" to enable push and pop of input contexts. This allows 41 "{" and "}" to create a local context for modifiers, such as TRANSPARENT. 42 Input modifiers specified outside of a local context become global for 43 subsequent input clauses. 44- Modify "pdf.c" to add creation and modification dates to the PDF 45 properties. The "CreationDate" and "ModDate" values are set to the time 46 that the PDF was created. 47- Modify "pdf.h" to change the page size limit from 45 inches (Reader 3.x) 48 to 200 inches (Reader 4.x and later), to add structures and parameters to 49 support the new features added to the parser, and to add the PDF 50 "producer" definition. 51- Modify "pdf_g4.c" to add support for color-mapping bilevel images. 52 Mapping allows a black and white image to be drawn as any two specified 53 colors. Useful for pages that are black-on-color or white-on-color. The 54 color mapping syntax is: 55 56 COLORMAP (<red> <green> <blue>) , (<red> <green> <blue>) ; 57 58 ...where the first triplet specifies the color to be displayed for black 59 and the second triplet specifies the color to be displayed for white. 60 61 Note that a two-color PNG is about twice the size of a Group 4 TIFF. 62 63 Implementation note: the colormap is added to the PDF as a string resource 64 and an indirect reference is made from the XObject. Tumble should keep 65 each colormap only once in the file by keeping a global list of the 66 string resources created. It doesn't. However, if the colormap used on 67 an image is identical to the one used on the previous image, it will reuse 68 the string resource. This covers the case of a section of colored pages. 69 However, a discontiguous run of colored pages, e.g., the front and back 70 covers, will store the colormap twice. 71 72- Modify "pdf_g4.c", "pdf_jpeg.c", "tumble.c", "tumble_jpeg.c", and 73 "tumble_pbm.c" to support color key masking (using the PDF Mask operator). 74 The syntax is: 75 76 TRANSPARENT ( <gray_range> ) ; 77 78 or: 79 80 TRANSPARENT ( <red_range> <green_range> <blue_range> ) ; 81 82 ...as a modifier to an input statement. <range> may be either a single 83 integer or a low..high range. 84 85 The range values must be compatible with the color space of the image. 86 For full-color images, the ranges would be 0..255. For grayscale images, 87 the range would be 0..255. For paletted images, the range is expressed 88 in palette entry numbers, which is much less likely to be useful than a 89 single palette value. 90 91- Modify "pdf_g4.c", "tumble_input.h", and "tumble_tiff.c" to add handling 92 of TIFF images with min-is-black photometric interpretation. 93 94- Modify "pdf_g4.c," "pdf_jpeg.c," and "pdf_png.c" to fix bugs in the 95 callbacks within these files. "pdf_write_stream" was called to write "Do" 96 commands with the XObject names without escaping restricted characters in 97 the name, which had been escaped when the corresponding directory was 98 written. This led to "Undefined XObject resource" errors when more than 99 26 images were overlaid on a page ("pdf_new_XObject" generates names of 100 the form "ImA", "ImB", etc., and the 27th name was "Im[", which must be 101 escaped, as "[" is a restricted character; the dictionary name was being 102 escaped to "Im#5b", but the "Do" command name was not). 103 104- Modify "pdf_page_label.c" to fix a bug wherein a page label specifying 105 prefix without a style (e.g., LABEL <prefix>) produces bad PDF (no labels 106 are displayed). Should output "/P <prefix>" but instead was outputting 107 "/S /P <prefix>". 108 109- Add new files "pdf_png.c" and "tumble_png.c" and modify "tumble_input.h" 110 to support PNG images (code from Daniel Glöckner via the tumble mailing 111 list). 112 113- Change PDF string handling in "pdf_prim.c" and "pdf_prim.h" to allow 114 embedded nulls by storing strings as character arrays plus length words. 115 116- Modify "parser.y", "scanner.l", "semantics.c", and "semantics.h" to 117 support blank pages, overlay images, color mapping, color-key masking, and 118 push/pop of input contexts. 119 120- Modify "tumble.c", "tumble_jpeg.c", and "tumble_pbm.c" to support overlay 121 images. Overlays allow one image to be placed on top of another, e.g., a 122 JPEG photo on a bilevel TIFF text page, at a specified position. Overlays 123 are drawn after the page on which the overlay is specified. The overlay 124 syntax is: 125 126 PAGE <number> [ { OVERLAY <length>, <length> ; ... } ] ; 127 128 To support multiple images per page, the "Contents" stream is replaced by 129 an array of stream objects. 130 131- Modify "tumble.c" to add a new -V option that prints the program version 132 to stdio. The version string printed is the PDF producer string. 133 134- Add new file "tumble_blank.c" and modify "tumble_input.c" and 135 "tumble_input.h" to support true blank pages. A blank page is a new PDF 136 page with no content. The blank page syntax is: 137 138 BLANK <size_clause> 139 140- Fix a bug that caused a double free in "tumble_input.c". 141 142- Modify "tumble_tiff.c" to suppress a "function defined but not used" 143 warning. 144 145- Modify "semantics.c" to reduce page label redundancy in the PDF. Tumble 146 was outputting a PageLabel entry for every page, rather than just for 147 pages where the labelling changed. This resulted in an unnecessarily 148 large label dictionary. Now allows page labels to default to 149 auto-generation when appropriate. 150 151- Modify "semantics.c" to change the program report from "<n> pages 152 specified" to "<n> images specified" because, due to overlay images, the 153 number of images does not necessarily equal the number of pages. 154