@@ 1406-1414 (lines=9) @@ | ||
1403 | { |
|
1404 | // Gray image |
|
1405 | $len = 2 * $w; |
|
1406 | for ($i = 0; $i < $h; $i++) |
|
1407 | { |
|
1408 | $pos = (1 + $len) * $i; |
|
1409 | $color .= $data[$pos]; |
|
1410 | $alpha .= $data[$pos]; |
|
1411 | $line = substr($data, $pos + 1, $len); |
|
1412 | $color .= preg_replace('/(.)./s', '$1', $line); |
|
1413 | $alpha .= preg_replace('/.(.)/s', '$1', $line); |
|
1414 | } |
|
1415 | } else |
|
1416 | { |
|
1417 | // RGB image |
|
@@ 1419-1427 (lines=9) @@ | ||
1416 | { |
|
1417 | // RGB image |
|
1418 | $len = 4 * $w; |
|
1419 | for ($i = 0; $i < $h; $i++) |
|
1420 | { |
|
1421 | $pos = (1 + $len) * $i; |
|
1422 | $color .= $data[$pos]; |
|
1423 | $alpha .= $data[$pos]; |
|
1424 | $line = substr($data, $pos + 1, $len); |
|
1425 | $color .= preg_replace('/(.{3})./s', '$1', $line); |
|
1426 | $alpha .= preg_replace('/.{3}(.)/s', '$1', $line); |
|
1427 | } |
|
1428 | } |
|
1429 | unset($data); |
|
1430 | $data = gzcompress($color); |