compress/

directory
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2018 License: MIT

README

Note

  • This is an improved version of compress/lzw.
  • Please refer to the golang proposal for details.

Problem

  • PDF's LZWDecode filter comes with the optional parameter EarlyChange.
  • The type of this parameter is int and the defined values are 0 and 1.
  • The default value is 1.

Without going into details this parameter implies a slight variation of lzw. (See the PDF spec).

compress/lzw:

  • the algorithm implied by EarlyChange value 1
  • provides both Reader and Writer.

golang.org/x/image/tiff/lzw (mirrored at):

  • the algorithm implied by EarlyChange value 0
  • provides a Reader, lacks a Writer

Further PDF expects a leading clear_table marker right at the beginning which is not smth the stdlib compress/lzw does.

There are numerous PDF Writers out there and the following can be observed on arbitrary PDF files that use the LZWDecode filter:

  • Some PDF writers do not write the EOD (end of data) marker.
  • Some PDF writers do not write the final bits after the EOD marker.

Directories

Path Synopsis
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.
Package lzw implements the Lempel-Ziv-Welch compressed data format, described in T. A. Welch, “A Technique for High-Performance Data Compression”, Computer, 17(6) (June 1984), pp 8-19.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL