@@ -64,30 +64,30 @@ |
||
| 64 | 64 | if ($this->debug) $opts[CURLINFO_HEADER_OUT] = TRUE; |
| 65 | 65 | if ($this->user && $this->pass) $opts[CURLOPT_USERPWD] = "$this->user:$this->pass"; |
| 66 | 66 | switch ($name) { |
| 67 | - case 'get': |
|
| 68 | - $opts[CURLOPT_HTTPGET] = TRUE; |
|
| 69 | - break; |
|
| 70 | - case 'post': |
|
| 71 | - $opts[CURLOPT_POST] = TRUE; |
|
| 72 | - $opts[CURLOPT_POSTFIELDS] = $req_body; |
|
| 73 | - break; |
|
| 74 | - case 'put': |
|
| 75 | - $opts[CURLOPT_PUT] = TRUE; |
|
| 76 | - if (strlen($req_body)) { |
|
| 77 | - if ($buf = fopen('php://memory', 'w+')) { |
|
| 78 | - fwrite($buf, $req_body); |
|
| 79 | - fseek($buf, 0); |
|
| 80 | - $opts[CURLOPT_INFILE] = $buf; |
|
| 81 | - $opts[CURLOPT_INFILESIZE] = strlen($req_body); |
|
| 82 | - } else throw new Services_Twilio_TinyHttpException('unable to open temporary file'); |
|
| 83 | - } |
|
| 84 | - break; |
|
| 85 | - case 'head': |
|
| 86 | - $opts[CURLOPT_NOBODY] = TRUE; |
|
| 87 | - break; |
|
| 88 | - default: |
|
| 89 | - $opts[CURLOPT_CUSTOMREQUEST] = strtoupper($name); |
|
| 90 | - break; |
|
| 67 | + case 'get': |
|
| 68 | + $opts[CURLOPT_HTTPGET] = TRUE; |
|
| 69 | + break; |
|
| 70 | + case 'post': |
|
| 71 | + $opts[CURLOPT_POST] = TRUE; |
|
| 72 | + $opts[CURLOPT_POSTFIELDS] = $req_body; |
|
| 73 | + break; |
|
| 74 | + case 'put': |
|
| 75 | + $opts[CURLOPT_PUT] = TRUE; |
|
| 76 | + if (strlen($req_body)) { |
|
| 77 | + if ($buf = fopen('php://memory', 'w+')) { |
|
| 78 | + fwrite($buf, $req_body); |
|
| 79 | + fseek($buf, 0); |
|
| 80 | + $opts[CURLOPT_INFILE] = $buf; |
|
| 81 | + $opts[CURLOPT_INFILESIZE] = strlen($req_body); |
|
| 82 | + } else throw new Services_Twilio_TinyHttpException('unable to open temporary file'); |
|
| 83 | + } |
|
| 84 | + break; |
|
| 85 | + case 'head': |
|
| 86 | + $opts[CURLOPT_NOBODY] = TRUE; |
|
| 87 | + break; |
|
| 88 | + default: |
|
| 89 | + $opts[CURLOPT_CUSTOMREQUEST] = strtoupper($name); |
|
| 90 | + break; |
|
| 91 | 91 | } |
| 92 | 92 | try { |
| 93 | 93 | if ($curl = curl_init()) { |
@@ -26,20 +26,20 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct($arg = null) { |
| 28 | 28 | switch (true) { |
| 29 | - case $arg instanceof SimpleXmlElement: |
|
| 30 | - $this->element = $arg; |
|
| 31 | - break; |
|
| 32 | - case $arg === null: |
|
| 33 | - $this->element = new SimpleXmlElement('<Response/>'); |
|
| 34 | - break; |
|
| 35 | - case is_array($arg): |
|
| 36 | - $this->element = new SimpleXmlElement('<Response/>'); |
|
| 37 | - foreach ($arg as $name => $value) { |
|
| 38 | - $this->element->addAttribute($name, $value); |
|
| 39 | - } |
|
| 40 | - break; |
|
| 41 | - default: |
|
| 42 | - throw new Services_Twilio_TwimlException('Invalid argument'); |
|
| 29 | + case $arg instanceof SimpleXmlElement: |
|
| 30 | + $this->element = $arg; |
|
| 31 | + break; |
|
| 32 | + case $arg === null: |
|
| 33 | + $this->element = new SimpleXmlElement('<Response/>'); |
|
| 34 | + break; |
|
| 35 | + case is_array($arg): |
|
| 36 | + $this->element = new SimpleXmlElement('<Response/>'); |
|
| 37 | + foreach ($arg as $name => $value) { |
|
| 38 | + $this->element->addAttribute($name, $value); |
|
| 39 | + } |
|
| 40 | + break; |
|
| 41 | + default: |
|
| 42 | + throw new Services_Twilio_TwimlException('Invalid argument'); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
@@ -313,22 +313,22 @@ |
||
| 313 | 313 | { |
| 314 | 314 | $apiBase = Pingpp::$apiBase; |
| 315 | 315 | switch ($errno) { |
| 316 | - case CURLE_COULDNT_CONNECT: |
|
| 317 | - case CURLE_COULDNT_RESOLVE_HOST: |
|
| 318 | - case CURLE_OPERATION_TIMEOUTED: |
|
| 319 | - $msg = "Could not connect to Ping++ ($apiBase). Please check your " |
|
| 320 | - . "internet connection and try again. If this problem persists, " |
|
| 321 | - . "you should check Pingpp's service status at " |
|
| 322 | - . "https://pingxx.com/status."; |
|
| 323 | - break; |
|
| 324 | - case CURLE_SSL_CACERT: |
|
| 325 | - case CURLE_SSL_PEER_CERTIFICATE: |
|
| 326 | - $msg = "Could not verify Ping++'s SSL certificate. Please make sure " |
|
| 327 | - . "that your network is not intercepting certificates. " |
|
| 328 | - . "(Try going to $apiBase in your browser.)"; |
|
| 329 | - break; |
|
| 330 | - default: |
|
| 331 | - $msg = "Unexpected error communicating with Ping++."; |
|
| 316 | + case CURLE_COULDNT_CONNECT: |
|
| 317 | + case CURLE_COULDNT_RESOLVE_HOST: |
|
| 318 | + case CURLE_OPERATION_TIMEOUTED: |
|
| 319 | + $msg = "Could not connect to Ping++ ($apiBase). Please check your " |
|
| 320 | + . "internet connection and try again. If this problem persists, " |
|
| 321 | + . "you should check Pingpp's service status at " |
|
| 322 | + . "https://pingxx.com/status."; |
|
| 323 | + break; |
|
| 324 | + case CURLE_SSL_CACERT: |
|
| 325 | + case CURLE_SSL_PEER_CERTIFICATE: |
|
| 326 | + $msg = "Could not verify Ping++'s SSL certificate. Please make sure " |
|
| 327 | + . "that your network is not intercepting certificates. " |
|
| 328 | + . "(Try going to $apiBase in your browser.)"; |
|
| 329 | + break; |
|
| 330 | + default: |
|
| 331 | + $msg = "Unexpected error communicating with Ping++."; |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | $msg .= "\n\n(Network error [errno $errno]: $message)"; |
@@ -57,61 +57,61 @@ |
||
| 57 | 57 | |
| 58 | 58 | switch ($_SERVER["argv"][$i]) { |
| 59 | 59 | |
| 60 | - case "--help": |
|
| 61 | - case "-h": |
|
| 62 | - $opts["h"] = true; |
|
| 63 | - $i++; |
|
| 64 | - break; |
|
| 65 | - |
|
| 66 | - case "-l": |
|
| 67 | - $opts["l"] = true; |
|
| 68 | - $i++; |
|
| 69 | - break; |
|
| 70 | - |
|
| 71 | - case "-p": |
|
| 72 | - if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 73 | - die("-p switch requires a size parameter\n"); |
|
| 74 | - $opts["p"] = $_SERVER["argv"][$i+1]; |
|
| 75 | - $i += 2; |
|
| 76 | - break; |
|
| 77 | - |
|
| 78 | - case "-o": |
|
| 79 | - if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 80 | - die("-o switch requires an orientation parameter\n"); |
|
| 81 | - $opts["o"] = $_SERVER["argv"][$i+1]; |
|
| 82 | - $i += 2; |
|
| 83 | - break; |
|
| 84 | - |
|
| 85 | - case "-b": |
|
| 86 | - if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 87 | - die("-b switch requires a path parameter\n"); |
|
| 88 | - $opts["b"] = $_SERVER["argv"][$i+1]; |
|
| 89 | - $i += 2; |
|
| 90 | - break; |
|
| 91 | - |
|
| 92 | - case "-f": |
|
| 93 | - if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 94 | - die("-f switch requires a filename parameter\n"); |
|
| 95 | - $opts["f"] = $_SERVER["argv"][$i+1]; |
|
| 96 | - $i += 2; |
|
| 97 | - break; |
|
| 98 | - |
|
| 99 | - case "-v": |
|
| 100 | - $opts["v"] = true; |
|
| 101 | - $i++; |
|
| 102 | - break; |
|
| 103 | - |
|
| 104 | - case "-d": |
|
| 105 | - $opts["d"] = true; |
|
| 106 | - $i++; |
|
| 107 | - break; |
|
| 108 | - |
|
| 109 | - case "-t": |
|
| 110 | - if ( !isset($_SERVER['argv'][$i + 1]) ) |
|
| 111 | - die("-t switch requires a comma separated list of types\n"); |
|
| 112 | - $opts["t"] = $_SERVER['argv'][$i+1]; |
|
| 113 | - $i += 2; |
|
| 114 | - break; |
|
| 60 | + case "--help": |
|
| 61 | + case "-h": |
|
| 62 | + $opts["h"] = true; |
|
| 63 | + $i++; |
|
| 64 | + break; |
|
| 65 | + |
|
| 66 | + case "-l": |
|
| 67 | + $opts["l"] = true; |
|
| 68 | + $i++; |
|
| 69 | + break; |
|
| 70 | + |
|
| 71 | + case "-p": |
|
| 72 | + if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 73 | + die("-p switch requires a size parameter\n"); |
|
| 74 | + $opts["p"] = $_SERVER["argv"][$i+1]; |
|
| 75 | + $i += 2; |
|
| 76 | + break; |
|
| 77 | + |
|
| 78 | + case "-o": |
|
| 79 | + if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 80 | + die("-o switch requires an orientation parameter\n"); |
|
| 81 | + $opts["o"] = $_SERVER["argv"][$i+1]; |
|
| 82 | + $i += 2; |
|
| 83 | + break; |
|
| 84 | + |
|
| 85 | + case "-b": |
|
| 86 | + if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 87 | + die("-b switch requires a path parameter\n"); |
|
| 88 | + $opts["b"] = $_SERVER["argv"][$i+1]; |
|
| 89 | + $i += 2; |
|
| 90 | + break; |
|
| 91 | + |
|
| 92 | + case "-f": |
|
| 93 | + if ( !isset($_SERVER["argv"][$i+1]) ) |
|
| 94 | + die("-f switch requires a filename parameter\n"); |
|
| 95 | + $opts["f"] = $_SERVER["argv"][$i+1]; |
|
| 96 | + $i += 2; |
|
| 97 | + break; |
|
| 98 | + |
|
| 99 | + case "-v": |
|
| 100 | + $opts["v"] = true; |
|
| 101 | + $i++; |
|
| 102 | + break; |
|
| 103 | + |
|
| 104 | + case "-d": |
|
| 105 | + $opts["d"] = true; |
|
| 106 | + $i++; |
|
| 107 | + break; |
|
| 108 | + |
|
| 109 | + case "-t": |
|
| 110 | + if ( !isset($_SERVER['argv'][$i + 1]) ) |
|
| 111 | + die("-t switch requires a comma separated list of types\n"); |
|
| 112 | + $opts["t"] = $_SERVER['argv'][$i+1]; |
|
| 113 | + $i += 2; |
|
| 114 | + break; |
|
| 115 | 115 | |
| 116 | 116 | default: |
| 117 | 117 | $opts["filename"] = $_SERVER["argv"][$i]; |
@@ -766,20 +766,20 @@ discard block |
||
| 766 | 766 | |
| 767 | 767 | switch ($type) { |
| 768 | 768 | |
| 769 | - case "jpg": |
|
| 770 | - case "jpeg": |
|
| 771 | - if ( !isset($options["quality"]) ) |
|
| 772 | - $options["quality"] = 75; |
|
| 769 | + case "jpg": |
|
| 770 | + case "jpeg": |
|
| 771 | + if ( !isset($options["quality"]) ) |
|
| 772 | + $options["quality"] = 75; |
|
| 773 | 773 | |
| 774 | - header("Content-type: image/jpeg"); |
|
| 775 | - imagejpeg($dst, '', $options["quality"]); |
|
| 776 | - break; |
|
| 777 | - |
|
| 778 | - case "png": |
|
| 779 | - default: |
|
| 780 | - header("Content-type: image/png"); |
|
| 781 | - imagepng($dst); |
|
| 782 | - break; |
|
| 774 | + header("Content-type: image/jpeg"); |
|
| 775 | + imagejpeg($dst, '', $options["quality"]); |
|
| 776 | + break; |
|
| 777 | + |
|
| 778 | + case "png": |
|
| 779 | + default: |
|
| 780 | + header("Content-type: image/png"); |
|
| 781 | + imagepng($dst); |
|
| 782 | + break; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | if ( $this->_aa_factor != 1 ) |
@@ -814,18 +814,18 @@ discard block |
||
| 814 | 814 | |
| 815 | 815 | switch ($type) { |
| 816 | 816 | |
| 817 | - case "jpg": |
|
| 818 | - case "jpeg": |
|
| 819 | - if ( !isset($options["quality"]) ) |
|
| 820 | - $options["quality"] = 75; |
|
| 817 | + case "jpg": |
|
| 818 | + case "jpeg": |
|
| 819 | + if ( !isset($options["quality"]) ) |
|
| 820 | + $options["quality"] = 75; |
|
| 821 | 821 | |
| 822 | - imagejpeg($dst, '', $options["quality"]); |
|
| 823 | - break; |
|
| 822 | + imagejpeg($dst, '', $options["quality"]); |
|
| 823 | + break; |
|
| 824 | 824 | |
| 825 | - case "png": |
|
| 826 | - default: |
|
| 827 | - imagepng($dst); |
|
| 828 | - break; |
|
| 825 | + case "png": |
|
| 826 | + default: |
|
| 827 | + imagepng($dst); |
|
| 828 | + break; |
|
| 829 | 829 | } |
| 830 | 830 | |
| 831 | 831 | $image = ob_get_clean(); |
@@ -401,29 +401,29 @@ |
||
| 401 | 401 | $new_style = "; border-collapse: collapse;"; |
| 402 | 402 | |
| 403 | 403 | switch ($value) { |
| 404 | - case "none": |
|
| 405 | - $new_style .= "border-style: none;"; |
|
| 406 | - break; |
|
| 404 | + case "none": |
|
| 405 | + $new_style .= "border-style: none;"; |
|
| 406 | + break; |
|
| 407 | 407 | |
| 408 | - case "groups": |
|
| 409 | - // FIXME: unsupported |
|
| 410 | - return null; |
|
| 408 | + case "groups": |
|
| 409 | + // FIXME: unsupported |
|
| 410 | + return null; |
|
| 411 | 411 | |
| 412 | - case "rows": |
|
| 413 | - $new_style .= "border-style: solid none solid none; border-width: 1px; "; |
|
| 414 | - break; |
|
| 412 | + case "rows": |
|
| 413 | + $new_style .= "border-style: solid none solid none; border-width: 1px; "; |
|
| 414 | + break; |
|
| 415 | 415 | |
| 416 | - case "cols": |
|
| 417 | - $new_style .= "border-style: none solid none solid; border-width: 1px; "; |
|
| 418 | - break; |
|
| 416 | + case "cols": |
|
| 417 | + $new_style .= "border-style: none solid none solid; border-width: 1px; "; |
|
| 418 | + break; |
|
| 419 | 419 | |
| 420 | - case "all": |
|
| 421 | - $new_style .= "border-style: solid; border-width: 1px; "; |
|
| 422 | - break; |
|
| 420 | + case "all": |
|
| 421 | + $new_style .= "border-style: solid; border-width: 1px; "; |
|
| 422 | + break; |
|
| 423 | 423 | |
| 424 | - default: |
|
| 425 | - // Invalid value |
|
| 426 | - return null; |
|
| 424 | + default: |
|
| 425 | + // Invalid value |
|
| 426 | + return null; |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | $cell_list = self::get_cell_list($node); |
@@ -123,33 +123,33 @@ discard block |
||
| 123 | 123 | continue; |
| 124 | 124 | |
| 125 | 125 | switch($side) { |
| 126 | - case "top": |
|
| 127 | - $length = $w; |
|
| 128 | - $r1 = $radius["top-left"]; |
|
| 129 | - $r2 = $radius["top-right"]; |
|
| 130 | - break; |
|
| 131 | - |
|
| 132 | - case "bottom": |
|
| 133 | - $length = $w; |
|
| 134 | - $y += $h; |
|
| 135 | - $r1 = $radius["bottom-left"]; |
|
| 136 | - $r2 = $radius["bottom-right"]; |
|
| 137 | - break; |
|
| 138 | - |
|
| 139 | - case "left": |
|
| 140 | - $length = $h; |
|
| 141 | - $r1 = $radius["top-left"]; |
|
| 142 | - $r2 = $radius["bottom-left"]; |
|
| 143 | - break; |
|
| 144 | - |
|
| 145 | - case "right": |
|
| 146 | - $length = $h; |
|
| 147 | - $x += $w; |
|
| 148 | - $r1 = $radius["top-right"]; |
|
| 149 | - $r2 = $radius["bottom-right"]; |
|
| 150 | - break; |
|
| 151 | - default: |
|
| 152 | - break; |
|
| 126 | + case "top": |
|
| 127 | + $length = $w; |
|
| 128 | + $r1 = $radius["top-left"]; |
|
| 129 | + $r2 = $radius["top-right"]; |
|
| 130 | + break; |
|
| 131 | + |
|
| 132 | + case "bottom": |
|
| 133 | + $length = $w; |
|
| 134 | + $y += $h; |
|
| 135 | + $r1 = $radius["bottom-left"]; |
|
| 136 | + $r2 = $radius["bottom-right"]; |
|
| 137 | + break; |
|
| 138 | + |
|
| 139 | + case "left": |
|
| 140 | + $length = $h; |
|
| 141 | + $r1 = $radius["top-left"]; |
|
| 142 | + $r2 = $radius["bottom-left"]; |
|
| 143 | + break; |
|
| 144 | + |
|
| 145 | + case "right": |
|
| 146 | + $length = $h; |
|
| 147 | + $x += $w; |
|
| 148 | + $r1 = $radius["top-right"]; |
|
| 149 | + $r2 = $radius["bottom-right"]; |
|
| 150 | + break; |
|
| 151 | + default: |
|
| 152 | + break; |
|
| 153 | 153 | } |
| 154 | 154 | $method = "_border_" . $props["style"]; |
| 155 | 155 | |
@@ -203,25 +203,25 @@ discard block |
||
| 203 | 203 | list($x, $y, $w, $h) = $border_box; |
| 204 | 204 | |
| 205 | 205 | switch($side) { |
| 206 | - case "top": |
|
| 207 | - $length = $w; |
|
| 208 | - break; |
|
| 209 | - |
|
| 210 | - case "bottom": |
|
| 211 | - $length = $w; |
|
| 212 | - $y += $h; |
|
| 213 | - break; |
|
| 214 | - |
|
| 215 | - case "left": |
|
| 216 | - $length = $h; |
|
| 217 | - break; |
|
| 218 | - |
|
| 219 | - case "right": |
|
| 220 | - $length = $h; |
|
| 221 | - $x += $w; |
|
| 222 | - break; |
|
| 223 | - default: |
|
| 224 | - break; |
|
| 206 | + case "top": |
|
| 207 | + $length = $w; |
|
| 208 | + break; |
|
| 209 | + |
|
| 210 | + case "bottom": |
|
| 211 | + $length = $w; |
|
| 212 | + $y += $h; |
|
| 213 | + break; |
|
| 214 | + |
|
| 215 | + case "left": |
|
| 216 | + $length = $h; |
|
| 217 | + break; |
|
| 218 | + |
|
| 219 | + case "right": |
|
| 220 | + $length = $h; |
|
| 221 | + $x += $w; |
|
| 222 | + break; |
|
| 223 | + default: |
|
| 224 | + break; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | $this->$method($x, $y, $length, $props["color"], $widths, $side, $corner_style); |
@@ -543,40 +543,40 @@ |
||
| 543 | 543 | protected function _apply_ratio($side, $ratio, $top, $right, $bottom, $left, &$x, &$y, &$length, &$r1, &$r2) { |
| 544 | 544 | switch ($side) { |
| 545 | 545 | |
| 546 | - case "top": |
|
| 547 | - $r1 -= $left * $ratio; |
|
| 548 | - $r2 -= $right * $ratio; |
|
| 549 | - $x += $left * $ratio; |
|
| 550 | - $y += $top * $ratio; |
|
| 551 | - $length -= $left * $ratio + $right * $ratio; |
|
| 552 | - break; |
|
| 546 | + case "top": |
|
| 547 | + $r1 -= $left * $ratio; |
|
| 548 | + $r2 -= $right * $ratio; |
|
| 549 | + $x += $left * $ratio; |
|
| 550 | + $y += $top * $ratio; |
|
| 551 | + $length -= $left * $ratio + $right * $ratio; |
|
| 552 | + break; |
|
| 553 | 553 | |
| 554 | - case "bottom": |
|
| 555 | - $r1 -= $right * $ratio; |
|
| 556 | - $r2 -= $left * $ratio; |
|
| 557 | - $x += $left * $ratio; |
|
| 558 | - $y -= $bottom * $ratio; |
|
| 559 | - $length -= $left * $ratio + $right * $ratio; |
|
| 560 | - break; |
|
| 554 | + case "bottom": |
|
| 555 | + $r1 -= $right * $ratio; |
|
| 556 | + $r2 -= $left * $ratio; |
|
| 557 | + $x += $left * $ratio; |
|
| 558 | + $y -= $bottom * $ratio; |
|
| 559 | + $length -= $left * $ratio + $right * $ratio; |
|
| 560 | + break; |
|
| 561 | 561 | |
| 562 | - case "left": |
|
| 563 | - $r1 -= $top * $ratio; |
|
| 564 | - $r2 -= $bottom * $ratio; |
|
| 565 | - $x += $left * $ratio; |
|
| 566 | - $y += $top * $ratio; |
|
| 567 | - $length -= $top * $ratio + $bottom * $ratio; |
|
| 568 | - break; |
|
| 562 | + case "left": |
|
| 563 | + $r1 -= $top * $ratio; |
|
| 564 | + $r2 -= $bottom * $ratio; |
|
| 565 | + $x += $left * $ratio; |
|
| 566 | + $y += $top * $ratio; |
|
| 567 | + $length -= $top * $ratio + $bottom * $ratio; |
|
| 568 | + break; |
|
| 569 | 569 | |
| 570 | - case "right": |
|
| 571 | - $r1 -= $bottom * $ratio; |
|
| 572 | - $r2 -= $top * $ratio; |
|
| 573 | - $x -= $right * $ratio; |
|
| 574 | - $y += $top * $ratio; |
|
| 575 | - $length -= $top * $ratio + $bottom * $ratio; |
|
| 576 | - break; |
|
| 570 | + case "right": |
|
| 571 | + $r1 -= $bottom * $ratio; |
|
| 572 | + $r2 -= $top * $ratio; |
|
| 573 | + $x -= $right * $ratio; |
|
| 574 | + $y += $top * $ratio; |
|
| 575 | + $length -= $top * $ratio + $bottom * $ratio; |
|
| 576 | + break; |
|
| 577 | 577 | |
| 578 | - default: |
|
| 579 | - return; |
|
| 578 | + default: |
|
| 579 | + return; |
|
| 580 | 580 | |
| 581 | 581 | } |
| 582 | 582 | } |
@@ -611,25 +611,25 @@ |
||
| 611 | 611 | if ($debug_png) print "[image:$img|$width|$height|$type]"; |
| 612 | 612 | |
| 613 | 613 | switch ($type) { |
| 614 | - case IMAGETYPE_JPEG: |
|
| 615 | - if ($debug_png) print '!!!jpg!!!'; |
|
| 616 | - $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h); |
|
| 617 | - break; |
|
| 614 | + case IMAGETYPE_JPEG: |
|
| 615 | + if ($debug_png) print '!!!jpg!!!'; |
|
| 616 | + $this->_pdf->addJpegFromFile($img, $x, $this->y($y) - $h, $w, $h); |
|
| 617 | + break; |
|
| 618 | 618 | |
| 619 | - case IMAGETYPE_GIF: |
|
| 620 | - case IMAGETYPE_BMP: |
|
| 621 | - if ($debug_png) print '!!!bmp or gif!!!'; |
|
| 622 | - // @todo use cache for BMP and GIF |
|
| 623 | - $img = $this->_convert_gif_bmp_to_png($img, $type); |
|
| 619 | + case IMAGETYPE_GIF: |
|
| 620 | + case IMAGETYPE_BMP: |
|
| 621 | + if ($debug_png) print '!!!bmp or gif!!!'; |
|
| 622 | + // @todo use cache for BMP and GIF |
|
| 623 | + $img = $this->_convert_gif_bmp_to_png($img, $type); |
|
| 624 | 624 | |
| 625 | - case IMAGETYPE_PNG: |
|
| 626 | - if ($debug_png) print '!!!png!!!'; |
|
| 625 | + case IMAGETYPE_PNG: |
|
| 626 | + if ($debug_png) print '!!!png!!!'; |
|
| 627 | 627 | |
| 628 | - $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h); |
|
| 629 | - break; |
|
| 628 | + $this->_pdf->addPngFromFile($img, $x, $this->y($y) - $h, $w, $h); |
|
| 629 | + break; |
|
| 630 | 630 | |
| 631 | - default: |
|
| 632 | - if ($debug_png) print '!!!unknown!!!'; |
|
| 631 | + default: |
|
| 632 | + if ($debug_png) print '!!!unknown!!!'; |
|
| 633 | 633 | } |
| 634 | 634 | } |
| 635 | 635 | |