@@ -62,8 +62,8 @@ |
||
62 | 62 | |
63 | 63 | // Preserve transparency |
64 | 64 | imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127)); |
65 | - imagealphablending($new, false); |
|
66 | - imagesavealpha($new, true); |
|
65 | + imagealphablending($new, false); |
|
66 | + imagesavealpha($new, true); |
|
67 | 67 | |
68 | 68 | imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $originalWidth, $originalHeight); |
69 | 69 |
@@ -31,11 +31,11 @@ discard block |
||
31 | 31 | */ |
32 | 32 | function shutdownHandler () { |
33 | 33 | $error = error_get_last(); |
34 | - if (isset($error['type'], $error['message'], $error['file'], $error['line'])) { |
|
35 | - errorHandler($error['type'],$error['message'],$error['file'],$error['line']); |
|
36 | - }elseif ($error['type'] == 1) { |
|
37 | - dump($error); |
|
38 | - } |
|
34 | + if (isset($error['type'], $error['message'], $error['file'], $error['line'])) { |
|
35 | + errorHandler($error['type'],$error['message'],$error['file'],$error['line']); |
|
36 | + }elseif ($error['type'] == 1) { |
|
37 | + dump($error); |
|
38 | + } |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -49,28 +49,28 @@ discard block |
||
49 | 49 | $jsonErrorNr = json_last_error(); |
50 | 50 | $errstr = ''; |
51 | 51 | switch ($jsonErrorNr) { |
52 | - case JSON_ERROR_NONE: |
|
53 | - $errstr .= ' - No errors' . PHP_EOL; |
|
54 | - break; |
|
55 | - case JSON_ERROR_DEPTH: |
|
56 | - $errstr .= ' - Maximum stack depth exceeded' . PHP_EOL; |
|
57 | - break; |
|
58 | - case JSON_ERROR_STATE_MISMATCH: |
|
59 | - $errstr .= ' - Underflow or the modes mismatch' . PHP_EOL; |
|
60 | - break; |
|
61 | - case JSON_ERROR_CTRL_CHAR: |
|
62 | - $errstr .= ' - Unexpected control character found' . PHP_EOL; |
|
63 | - break; |
|
64 | - case JSON_ERROR_SYNTAX: |
|
65 | - $errstr .= ' - Syntax error, malformed JSON' . PHP_EOL; |
|
66 | - break; |
|
67 | - case JSON_ERROR_UTF8: |
|
68 | - $errstr .= ' - Malformed UTF-8 characters, possibly incorrectly encoded' . PHP_EOL; |
|
69 | - break; |
|
70 | - default: |
|
71 | - $errstr = ' - Unknown error' . PHP_EOL; |
|
72 | - break; |
|
73 | - } |
|
52 | + case JSON_ERROR_NONE: |
|
53 | + $errstr .= ' - No errors' . PHP_EOL; |
|
54 | + break; |
|
55 | + case JSON_ERROR_DEPTH: |
|
56 | + $errstr .= ' - Maximum stack depth exceeded' . PHP_EOL; |
|
57 | + break; |
|
58 | + case JSON_ERROR_STATE_MISMATCH: |
|
59 | + $errstr .= ' - Underflow or the modes mismatch' . PHP_EOL; |
|
60 | + break; |
|
61 | + case JSON_ERROR_CTRL_CHAR: |
|
62 | + $errstr .= ' - Unexpected control character found' . PHP_EOL; |
|
63 | + break; |
|
64 | + case JSON_ERROR_SYNTAX: |
|
65 | + $errstr .= ' - Syntax error, malformed JSON' . PHP_EOL; |
|
66 | + break; |
|
67 | + case JSON_ERROR_UTF8: |
|
68 | + $errstr .= ' - Malformed UTF-8 characters, possibly incorrectly encoded' . PHP_EOL; |
|
69 | + break; |
|
70 | + default: |
|
71 | + $errstr = ' - Unknown error' . PHP_EOL; |
|
72 | + break; |
|
73 | + } |
|
74 | 74 | errorHandler ($jsonErrorNr, $errstr, $file, $line); |
75 | 75 | } |
76 | 76 | |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | */ |
87 | 87 | function renderError ($message='', $file='', $line='', $code=0, $trace=array(), $httpHeader = 'HTTP/1.0 500 Internal Server Error') { |
88 | 88 | $file_lines = file_exists($file) ? file($file) : array(); |
89 | - $range = ($line - 15) < 0 ? range(1, 30) : range($line - 15, $line + 15); |
|
90 | - $lines = array(); |
|
89 | + $range = ($line - 15) < 0 ? range(1, 30) : range($line - 15, $line + 15); |
|
90 | + $lines = array(); |
|
91 | 91 | |
92 | - foreach ($range as $line_number) { |
|
93 | - if(isset($file_lines[$line_number-1])) { |
|
94 | - $lines[$line_number] = $file_lines[$line_number-1]; |
|
95 | - } |
|
96 | - } |
|
92 | + foreach ($range as $line_number) { |
|
93 | + if(isset($file_lines[$line_number-1])) { |
|
94 | + $lines[$line_number] = $file_lines[$line_number-1]; |
|
95 | + } |
|
96 | + } |
|
97 | 97 | if (ob_get_contents()) ob_end_clean(); |
98 | 98 | $error = array( |
99 | 99 | 'message' => $message, |
@@ -62,8 +62,8 @@ |
||
62 | 62 | |
63 | 63 | // Preserve transparency |
64 | 64 | imagecolortransparent($new, imagecolorallocatealpha($new, 0, 0, 0, 127)); |
65 | - imagealphablending($new, false); |
|
66 | - imagesavealpha($new, true); |
|
65 | + imagealphablending($new, false); |
|
66 | + imagesavealpha($new, true); |
|
67 | 67 | |
68 | 68 | imagecopyresampled($new, $imageResource, $this->_destX, $this->_destY, $this->_x, $this->_y, $this->_destWidth, $this->_destHeight, $originalWidth, $originalHeight); |
69 | 69 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | /** |
18 | 18 | * @param resource $imageResource |
19 | 19 | * @return resource |
20 | - */ |
|
20 | + */ |
|
21 | 21 | public function Execute($imageResource) |
22 | 22 | { |
23 | 23 | // Define the origial width and height |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | /** |
787 | 787 | * @param $filename |
788 | 788 | * @return null |
789 | - */ |
|
789 | + */ |
|
790 | 790 | public function getImageByName($filename) |
791 | 791 | { |
792 | 792 | $images = $this->getImages(); |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | /** |
877 | 877 | * @param $filename |
878 | 878 | * @return null |
879 | - */ |
|
879 | + */ |
|
880 | 880 | public function getFileByName($filename) |
881 | 881 | { |
882 | 882 | $files = $this->getFiles(); |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | /** |
892 | 892 | * @param $filename |
893 | 893 | * @throws \Exception |
894 | - */ |
|
894 | + */ |
|
895 | 895 | public function deleteFileByName($filename) |
896 | 896 | { |
897 | 897 | $destinationPath = realpath(__DIR__ . '/../../www/files/'); |