diff options
Diffstat (limited to 'inc/3rdparty/libraries/mpdf/mpdfi/filters')
-rw-r--r-- | inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterASCII85.php | 98 | ||||
-rw-r--r-- | inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterLZW.php | 154 |
2 files changed, 0 insertions, 252 deletions
diff --git a/inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterASCII85.php b/inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterASCII85.php deleted file mode 100644 index fc42d574..00000000 --- a/inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterASCII85.php +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | <?php | ||
2 | // | ||
3 | // FPDI - Version 1.3.1 | ||
4 | // | ||
5 | // Copyright 2004-2009 Setasign - Jan Slabon | ||
6 | // | ||
7 | // Licensed under the Apache License, Version 2.0 (the "License"); | ||
8 | // you may not use this file except in compliance with the License. | ||
9 | // You may obtain a copy of the License at | ||
10 | // | ||
11 | // http://www.apache.org/licenses/LICENSE-2.0 | ||
12 | // | ||
13 | // Unless required by applicable law or agreed to in writing, software | ||
14 | // distributed under the License is distributed on an "AS IS" BASIS, | ||
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
16 | // See the License for the specific language governing permissions and | ||
17 | // limitations under the License. | ||
18 | // | ||
19 | |||
20 | if (!defined('ORD_z')) | ||
21 | define('ORD_z',ord('z')); | ||
22 | if (!defined('ORD_exclmark')) | ||
23 | define('ORD_exclmark', ord('!')); | ||
24 | if (!defined('ORD_u')) | ||
25 | define('ORD_u', ord('u')); | ||
26 | if (!defined('ORD_tilde')) | ||
27 | define('ORD_tilde', ord('~')); | ||
28 | |||
29 | class FilterASCII85 { | ||
30 | |||
31 | function error($msg) { | ||
32 | die($msg); | ||
33 | } | ||
34 | |||
35 | function decode($in) { | ||
36 | $out = ''; | ||
37 | $state = 0; | ||
38 | $chn = null; | ||
39 | |||
40 | $l = strlen($in); | ||
41 | |||
42 | for ($k = 0; $k < $l; ++$k) { | ||
43 | $ch = ord($in[$k]) & 0xff; | ||
44 | |||
45 | if ($ch == ORD_tilde) { | ||
46 | break; | ||
47 | } | ||
48 | if (preg_match('/^\s$/',chr($ch))) { | ||
49 | continue; | ||
50 | } | ||
51 | if ($ch == ORD_z && $state == 0) { | ||
52 | $out .= chr(0).chr(0).chr(0).chr(0); | ||
53 | continue; | ||
54 | } | ||
55 | if ($ch < ORD_exclmark || $ch > ORD_u) { | ||
56 | $this->error('Illegal character in ASCII85Decode.'); | ||
57 | } | ||
58 | |||
59 | $chn[$state++] = $ch - ORD_exclmark; | ||
60 | |||
61 | if ($state == 5) { | ||
62 | $state = 0; | ||
63 | $r = 0; | ||
64 | for ($j = 0; $j < 5; ++$j) | ||
65 | $r = $r * 85 + $chn[$j]; | ||
66 | $out .= chr($r >> 24); | ||
67 | $out .= chr($r >> 16); | ||
68 | $out .= chr($r >> 8); | ||
69 | $out .= chr($r); | ||
70 | } | ||
71 | } | ||
72 | $r = 0; | ||
73 | |||
74 | if ($state == 1) | ||
75 | $this->error('Illegal length in ASCII85Decode.'); | ||
76 | if ($state == 2) { | ||
77 | $r = $chn[0] * 85 * 85 * 85 * 85 + ($chn[1]+1) * 85 * 85 * 85; | ||
78 | $out .= chr($r >> 24); | ||
79 | } | ||
80 | else if ($state == 3) { | ||
81 | $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + ($chn[2]+1) * 85 * 85; | ||
82 | $out .= chr($r >> 24); | ||
83 | $out .= chr($r >> 16); | ||
84 | } | ||
85 | else if ($state == 4) { | ||
86 | $r = $chn[0] * 85 * 85 * 85 * 85 + $chn[1] * 85 * 85 * 85 + $chn[2] * 85 * 85 + ($chn[3]+1) * 85 ; | ||
87 | $out .= chr($r >> 24); | ||
88 | $out .= chr($r >> 16); | ||
89 | $out .= chr($r >> 8); | ||
90 | } | ||
91 | |||
92 | return $out; | ||
93 | } | ||
94 | |||
95 | function encode($in) { | ||
96 | $this->error("ASCII85 encoding not implemented."); | ||
97 | } | ||
98 | } \ No newline at end of file | ||
diff --git a/inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterLZW.php b/inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterLZW.php deleted file mode 100644 index 5867603f..00000000 --- a/inc/3rdparty/libraries/mpdf/mpdfi/filters/FilterLZW.php +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | <?php | ||
2 | // | ||
3 | // FPDI - Version 1.3.1 | ||
4 | // | ||
5 | // Copyright 2004-2009 Setasign - Jan Slabon | ||
6 | // | ||
7 | // Licensed under the Apache License, Version 2.0 (the "License"); | ||
8 | // you may not use this file except in compliance with the License. | ||
9 | // You may obtain a copy of the License at | ||
10 | // | ||
11 | // http://www.apache.org/licenses/LICENSE-2.0 | ||
12 | // | ||
13 | // Unless required by applicable law or agreed to in writing, software | ||
14 | // distributed under the License is distributed on an "AS IS" BASIS, | ||
15 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
16 | // See the License for the specific language governing permissions and | ||
17 | // limitations under the License. | ||
18 | // | ||
19 | |||
20 | class FilterLZW { | ||
21 | |||
22 | var $sTable = array(); | ||
23 | var $data = null; | ||
24 | var $dataLength = 0; | ||
25 | var $tIdx; | ||
26 | var $bitsToGet = 9; | ||
27 | var $bytePointer; | ||
28 | var $bitPointer; | ||
29 | var $nextData = 0; | ||
30 | var $nextBits = 0; | ||
31 | var $andTable = array(511, 1023, 2047, 4095); | ||
32 | |||
33 | function error($msg) { | ||
34 | die($msg); | ||
35 | } | ||
36 | |||
37 | /** | ||
38 | * Method to decode LZW compressed data. | ||
39 | * | ||
40 | * @param string data The compressed data. | ||
41 | */ | ||
42 | function decode($data) { | ||
43 | |||
44 | if($data[0] == 0x00 && $data[1] == 0x01) { | ||
45 | $this->error('LZW flavour not supported.'); | ||
46 | } | ||
47 | |||
48 | $this->initsTable(); | ||
49 | |||
50 | $this->data = $data; | ||
51 | $this->dataLength = strlen($data); | ||
52 | |||
53 | // Initialize pointers | ||
54 | $this->bytePointer = 0; | ||
55 | $this->bitPointer = 0; | ||
56 | |||
57 | $this->nextData = 0; | ||
58 | $this->nextBits = 0; | ||
59 | |||
60 | $oldCode = 0; | ||
61 | |||
62 | $string = ''; | ||
63 | $uncompData = ''; | ||
64 | |||
65 | while (($code = $this->getNextCode()) != 257) { | ||
66 | if ($code == 256) { | ||
67 | $this->initsTable(); | ||
68 | $code = $this->getNextCode(); | ||
69 | |||
70 | if ($code == 257) { | ||
71 | break; | ||
72 | } | ||
73 | |||
74 | $uncompData .= $this->sTable[$code]; | ||
75 | $oldCode = $code; | ||
76 | |||
77 | } else { | ||
78 | |||
79 | if ($code < $this->tIdx) { | ||
80 | $string = $this->sTable[$code]; | ||
81 | $uncompData .= $string; | ||
82 | |||
83 | $this->addStringToTable($this->sTable[$oldCode], $string[0]); | ||
84 | $oldCode = $code; | ||
85 | } else { | ||
86 | $string = $this->sTable[$oldCode]; | ||
87 | $string = $string.$string[0]; | ||
88 | $uncompData .= $string; | ||
89 | |||
90 | $this->addStringToTable($string); | ||
91 | $oldCode = $code; | ||
92 | } | ||
93 | } | ||
94 | } | ||
95 | |||
96 | return $uncompData; | ||
97 | } | ||
98 | |||
99 | |||
100 | /** | ||
101 | * Initialize the string table. | ||
102 | */ | ||
103 | function initsTable() { | ||
104 | $this->sTable = array(); | ||
105 | |||
106 | for ($i = 0; $i < 256; $i++) | ||
107 | $this->sTable[$i] = chr($i); | ||
108 | |||
109 | $this->tIdx = 258; | ||
110 | $this->bitsToGet = 9; | ||
111 | } | ||
112 | |||
113 | /** | ||
114 | * Add a new string to the string table. | ||
115 | */ | ||
116 | function addStringToTable ($oldString, $newString='') { | ||
117 | $string = $oldString.$newString; | ||
118 | |||
119 | // Add this new String to the table | ||
120 | $this->sTable[$this->tIdx++] = $string; | ||
121 | |||
122 | if ($this->tIdx == 511) { | ||
123 | $this->bitsToGet = 10; | ||
124 | } else if ($this->tIdx == 1023) { | ||
125 | $this->bitsToGet = 11; | ||
126 | } else if ($this->tIdx == 2047) { | ||
127 | $this->bitsToGet = 12; | ||
128 | } | ||
129 | } | ||
130 | |||
131 | // Returns the next 9, 10, 11 or 12 bits | ||
132 | function getNextCode() { | ||
133 | if ($this->bytePointer == $this->dataLength) { | ||
134 | return 257; | ||
135 | } | ||
136 | |||
137 | $this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff); | ||
138 | $this->nextBits += 8; | ||
139 | |||
140 | if ($this->nextBits < $this->bitsToGet) { | ||
141 | $this->nextData = ($this->nextData << 8) | (ord($this->data[$this->bytePointer++]) & 0xff); | ||
142 | $this->nextBits += 8; | ||
143 | } | ||
144 | |||
145 | $code = ($this->nextData >> ($this->nextBits - $this->bitsToGet)) & $this->andTable[$this->bitsToGet-9]; | ||
146 | $this->nextBits -= $this->bitsToGet; | ||
147 | |||
148 | return $code; | ||
149 | } | ||
150 | |||
151 | function encode($in) { | ||
152 | $this->error("LZW encoding not implemented."); | ||
153 | } | ||
154 | } \ No newline at end of file | ||