@@ -2308,12 +2308,13 @@ discard block |
||
| 2308 | 2308 | define('_DIR_CHMOD', $pi); |
| 2309 | 2309 | } |
| 2310 | 2310 | |
| 2311 | - if (!isset($GLOBALS['test_dirs'])) |
|
| 2312 | - // Pas $pi car il est bon de le mettre hors ecriture apres intstall |
|
| 2311 | + if (!isset($GLOBALS['test_dirs'])) { |
|
| 2312 | + // Pas $pi car il est bon de le mettre hors ecriture apres intstall |
|
| 2313 | 2313 | // il sera rajoute automatiquement si besoin a l'etape 2 de l'install |
| 2314 | 2314 | { |
| 2315 | 2315 | $GLOBALS['test_dirs'] = array($pa, $ti, $ta); |
| 2316 | 2316 | } |
| 2317 | + } |
|
| 2317 | 2318 | |
| 2318 | 2319 | // Declaration des fichiers |
| 2319 | 2320 | |
@@ -3390,8 +3391,7 @@ discard block |
||
| 3390 | 3391 | and $h = svg_dimension_to_pixels($attrs['height'])) { |
| 3391 | 3392 | $width = $w; |
| 3392 | 3393 | $height = $h; |
| 3393 | - } |
|
| 3394 | - elseif (isset($attrs['viewBox'])) { |
|
| 3394 | + } elseif (isset($attrs['viewBox'])) { |
|
| 3395 | 3395 | $viewbox = trim($attrs['viewBox']); |
| 3396 | 3396 | $viewbox = preg_replace(",\s+,", " ", $viewbox); |
| 3397 | 3397 | $viewbox = explode(" ", $viewbox); |
@@ -357,8 +357,7 @@ discard block |
||
| 357 | 357 | process_image_svg_identite($ret); |
| 358 | 358 | $ret['creer'] = false; |
| 359 | 359 | } |
| 360 | - } |
|
| 361 | - else { |
|
| 360 | + } else { |
|
| 362 | 361 | if (!function_exists($ret["fonction_imagecreatefrom"])) { |
| 363 | 362 | return false; |
| 364 | 363 | } |
@@ -404,8 +403,7 @@ discard block |
||
| 404 | 403 | |
| 405 | 404 | if (isset($info['mime'])) { |
| 406 | 405 | $mime = $info['mime']; |
| 407 | - } |
|
| 408 | - else { |
|
| 406 | + } else { |
|
| 409 | 407 | $mime = image_type_to_mime_type($info[2]); |
| 410 | 408 | } |
| 411 | 409 | |
@@ -1100,9 +1098,7 @@ discard block |
||
| 1100 | 1098 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1101 | 1099 | $vignette = $destination . '.' . $format; |
| 1102 | 1100 | @copy($image, $vignette); |
| 1103 | - } |
|
| 1104 | - |
|
| 1105 | - elseif ($valeurs["format_source"] === 'svg') { |
|
| 1101 | + } elseif ($valeurs["format_source"] === 'svg') { |
|
| 1106 | 1102 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)){ |
| 1107 | 1103 | $format_sortie = 'svg'; |
| 1108 | 1104 | $vignette = $destination . "." . $format_sortie; |
@@ -1527,8 +1523,7 @@ discard block |
||
| 1527 | 1523 | $date = test_espace_prive() ? ('?' . $date) : ''; |
| 1528 | 1524 | |
| 1529 | 1525 | return _image_ecrire_tag($image, array('src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight)); |
| 1530 | - } |
|
| 1531 | - else { |
|
| 1526 | + } else { |
|
| 1532 | 1527 | # BMP, tiff ... les redacteurs osent tout! |
| 1533 | 1528 | return $img; |
| 1534 | 1529 | } |
@@ -65,8 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | if (is_null($maxlen)) { |
| 67 | 67 | $image = file_get_contents($fichier); |
| 68 | - } |
|
| 69 | - else { |
|
| 68 | + } else { |
|
| 70 | 69 | $image = file_get_contents($fichier, false,null,0, $maxlen); |
| 71 | 70 | } |
| 72 | 71 | // est-ce bien une image svg ? |
@@ -193,8 +192,7 @@ discard block |
||
| 193 | 192 | |
| 194 | 193 | if ($start === false or $start === 'end') { |
| 195 | 194 | $svg = str_replace("</svg>", $shapes . "</svg>", $svg); |
| 196 | - } |
|
| 197 | - else { |
|
| 195 | + } else { |
|
| 198 | 196 | $p = stripos($svg, "<svg"); |
| 199 | 197 | $p = strpos($svg, ">", $p); |
| 200 | 198 | $svg = substr_replace($svg, $shapes, $p+1, 0); |
@@ -255,8 +253,7 @@ discard block |
||
| 255 | 253 | if (strpos($couleur, "rgb(")===0) { |
| 256 | 254 | $c = explode(',', substr($couleur, 4)); |
| 257 | 255 | $couleur = _couleur_dec_to_hex(intval($c[0]), intval($c[1]), intval($c[2])); |
| 258 | - } |
|
| 259 | - else { |
|
| 256 | + } else { |
|
| 260 | 257 | $couleur = couleur_html_to_hex($couleur); |
| 261 | 258 | } |
| 262 | 259 | $couleur = '#'.ltrim($couleur,'#'); |
@@ -297,8 +294,7 @@ discard block |
||
| 297 | 294 | // il nous faut une viewBox |
| 298 | 295 | if (!isset($attributs['viewBox'])) { |
| 299 | 296 | $viewBox = "0 0 " . $attributs['width'] . " " . $attributs['height']; |
| 300 | - } |
|
| 301 | - else { |
|
| 297 | + } else { |
|
| 302 | 298 | $viewBox = $attributs['viewBox']; |
| 303 | 299 | } |
| 304 | 300 | // et on la convertit en px |
@@ -411,8 +407,7 @@ discard block |
||
| 411 | 407 | if (isset($attributs['viewBox'])) { |
| 412 | 408 | $viewBox = explode(' ', $attributs['viewBox']); |
| 413 | 409 | $rect = "<rect x=\"".$viewBox[0]."\" y=\"".$viewBox[1]."\" width=\"".$viewBox[2]."\" height=\"".$viewBox[3]."\" fill=\"$background_color\"/>"; |
| 414 | - } |
|
| 415 | - else { |
|
| 410 | + } else { |
|
| 416 | 411 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 417 | 412 | } |
| 418 | 413 | $svg = svg_insert_shapes($svg, $rect); |
@@ -440,8 +435,7 @@ discard block |
||
| 440 | 435 | if (isset($attributs['viewBox'])) { |
| 441 | 436 | $viewBox = explode(' ', $attributs['viewBox']); |
| 442 | 437 | $rect = "<rect x=\"".$viewBox[0]."\" y=\"".$viewBox[1]."\" width=\"".$viewBox[2]."\" height=\"".$viewBox[3]."\" fill=\"$background_color\" opacity=\"$opacity\"/>"; |
| 443 | - } |
|
| 444 | - else { |
|
| 438 | + } else { |
|
| 445 | 439 | $rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>"; |
| 446 | 440 | } |
| 447 | 441 | $svg = svg_insert_shapes($svg, $rect, false); |
@@ -501,8 +495,7 @@ discard block |
||
| 501 | 495 | $x = intval($viewBox[0]) + intval($viewBox[2]/2); |
| 502 | 496 | $mx = -$x; |
| 503 | 497 | $transform = "translate($x, 0) $transform translate($mx, 0)"; |
| 504 | - } |
|
| 505 | - else { |
|
| 498 | + } else { |
|
| 506 | 499 | $transform = "scale(1,-1)"; |
| 507 | 500 | |
| 508 | 501 | $y = intval($viewBox[1]) + intval($viewBox[3]/2); |
@@ -561,8 +554,7 @@ discard block |
||
| 561 | 554 | $c = array_shift($colors); |
| 562 | 555 | if (strlen($c) == 4) { |
| 563 | 556 | $short[] = $c; |
| 564 | - } |
|
| 565 | - else { |
|
| 557 | + } else { |
|
| 566 | 558 | $long[] = $c; |
| 567 | 559 | } |
| 568 | 560 | } |