compress/

directory
v0.1.13 Latest Latest
Warning

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

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

README

Note

  • This is the PDF variant 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.

This parameter implies two variants 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 is derived from compress/lzw in order to implement Adobe's PDF lzw compression as defined for the LZWDecode filter.
Package lzw is derived from compress/lzw in order to implement Adobe's PDF lzw compression as defined for the LZWDecode filter.

Jump to

Keyboard shortcuts

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