@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | $blue = dechex($blue); |
| 44 | 44 | |
| 45 | 45 | if (strlen($red) == 1) { |
| 46 | - $red = '0' . $red; |
|
| 46 | + $red = '0'.$red; |
|
| 47 | 47 | } |
| 48 | 48 | if (strlen($green) == 1) { |
| 49 | - $green = '0' . $green; |
|
| 49 | + $green = '0'.$green; |
|
| 50 | 50 | } |
| 51 | 51 | if (strlen($blue) == 1) { |
| 52 | - $blue = '0' . $blue; |
|
| 52 | + $blue = '0'.$blue; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | return "$red$green$blue"; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $couleur = couleur_html_to_hex($couleur); |
| 69 | 69 | $couleur = ltrim($couleur, '#'); |
| 70 | 70 | if (strlen($couleur) === 3) { |
| 71 | - $couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2]; |
|
| 71 | + $couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2]; |
|
| 72 | 72 | } |
| 73 | 73 | $retour = []; |
| 74 | 74 | $retour['red'] = hexdec(substr($couleur, 0, 2)); |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | $var_G = ($G / 255); |
| 127 | 127 | $var_B = ($B / 255); |
| 128 | 128 | |
| 129 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 130 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 131 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 129 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 130 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 131 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 132 | 132 | |
| 133 | 133 | $L = ($var_Max + $var_Min) / 2; |
| 134 | 134 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | function _couleur_hsl_to_rgb($H, $S, $L) { |
| 192 | 192 | // helper |
| 193 | - $hue_2_rgb = function ($v1, $v2, $vH) { |
|
| 193 | + $hue_2_rgb = function($v1, $v2, $vH) { |
|
| 194 | 194 | if ($vH < 0) { |
| 195 | 195 | $vH += 1; |
| 196 | 196 | } |
@@ -322,11 +322,11 @@ discard block |
||
| 322 | 322 | $img = "<img src='$source' />"; |
| 323 | 323 | } elseif ( |
| 324 | 324 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 325 | - and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]) |
|
| 325 | + and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]) |
|
| 326 | 326 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 327 | 327 | ) { |
| 328 | 328 | # gerer img src="data:....base64" |
| 329 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 329 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 330 | 330 | if (!file_exists($local)) { |
| 331 | 331 | ecrire_fichier($local, base64_decode($regs[2])); |
| 332 | 332 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | // les protocoles web prennent au moins 3 lettres |
| 344 | 344 | if (tester_url_absolue($source)) { |
| 345 | 345 | include_spip('inc/distant'); |
| 346 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 346 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 347 | 347 | if (!$fichier) { |
| 348 | 348 | return ''; |
| 349 | 349 | } |
@@ -445,9 +445,9 @@ discard block |
||
| 445 | 445 | // on garde la terminaison initiale car image simplement copiee |
| 446 | 446 | // et on postfixe son nom avec un md5 du path |
| 447 | 447 | $terminaison_dest = $terminaison; |
| 448 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 448 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 449 | 449 | } else { |
| 450 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 450 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 451 | 451 | } |
| 452 | 452 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 453 | 453 | $cache = sous_repertoire($cache, $effet); |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | $fichier_dest = substr($fichier_dest, 2); |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 461 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 462 | 462 | |
| 463 | 463 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 464 | 464 | |
@@ -496,15 +496,15 @@ discard block |
||
| 496 | 496 | |
| 497 | 497 | if ($creer) { |
| 498 | 498 | spip_log( |
| 499 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 500 | - 'images' . _LOG_DEBUG |
|
| 499 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 500 | + 'images'._LOG_DEBUG |
|
| 501 | 501 | ); |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 505 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 505 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 506 | 506 | $ret['fichier'] = $fichier; |
| 507 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 507 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 508 | 508 | $ret['fichier_dest'] = $fichier_dest; |
| 509 | 509 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 510 | 510 | $ret['format_dest'] = $terminaison_dest; |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | |
| 655 | 655 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 656 | 656 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 657 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 657 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 658 | 658 | $terminaison = $_terminaison; |
| 659 | 659 | } |
| 660 | 660 | return $terminaison; |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | if (!function_exists('imagepng')) { |
| 812 | 812 | return false; |
| 813 | 813 | } |
| 814 | - $tmp = $fichier . '.tmp'; |
|
| 814 | + $tmp = $fichier.'.tmp'; |
|
| 815 | 815 | $ret = imagepng($img, $tmp); |
| 816 | 816 | if (file_exists($tmp)) { |
| 817 | 817 | $taille_test = @getimagesize($tmp); |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | if (!function_exists('imagegif')) { |
| 847 | 847 | return false; |
| 848 | 848 | } |
| 849 | - $tmp = $fichier . '.tmp'; |
|
| 849 | + $tmp = $fichier.'.tmp'; |
|
| 850 | 850 | $ret = imagegif($img, $tmp); |
| 851 | 851 | if (file_exists($tmp)) { |
| 852 | 852 | $taille_test = @getimagesize($tmp); |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | if (!function_exists('imagejpeg')) { |
| 887 | 887 | return false; |
| 888 | 888 | } |
| 889 | - $tmp = $fichier . '.tmp'; |
|
| 889 | + $tmp = $fichier.'.tmp'; |
|
| 890 | 890 | |
| 891 | 891 | // Enable interlancing |
| 892 | 892 | imageinterlace($img, true); |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | if (!function_exists('imagewebp')) { |
| 948 | 948 | return false; |
| 949 | 949 | } |
| 950 | - $tmp = $fichier . '.tmp'; |
|
| 950 | + $tmp = $fichier.'.tmp'; |
|
| 951 | 951 | $ret = imagewebp($img, $tmp, $qualite); |
| 952 | 952 | if (file_exists($tmp)) { |
| 953 | 953 | $taille_test = @getimagesize($tmp); |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | */ |
| 982 | 982 | function _image_imagesvg($img, $fichier) { |
| 983 | 983 | |
| 984 | - $tmp = $fichier . '.tmp'; |
|
| 984 | + $tmp = $fichier.'.tmp'; |
|
| 985 | 985 | if (strpos($img, '<') === false) { |
| 986 | 986 | $img = supprimer_timestamp($img); |
| 987 | 987 | if (!file_exists($img)) { |
@@ -1038,13 +1038,13 @@ discard block |
||
| 1038 | 1038 | */ |
| 1039 | 1039 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1040 | 1040 | if (is_null($fonction)) { |
| 1041 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1041 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1042 | 1042 | } |
| 1043 | 1043 | $ret = false; |
| 1044 | 1044 | #un flag pour reperer les images gravees |
| 1045 | 1045 | $lock = ( |
| 1046 | 1046 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1047 | - or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')) |
|
| 1047 | + or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')) |
|
| 1048 | 1048 | ); |
| 1049 | 1049 | if ( |
| 1050 | 1050 | function_exists($fonction) |
@@ -1056,7 +1056,7 @@ discard block |
||
| 1056 | 1056 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1057 | 1057 | [$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']); |
| 1058 | 1058 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1059 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1059 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1060 | 1060 | } |
| 1061 | 1061 | } |
| 1062 | 1062 | |
@@ -1231,7 +1231,7 @@ discard block |
||
| 1231 | 1231 | |
| 1232 | 1232 | // attributs deprecies. Transformer en CSS |
| 1233 | 1233 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1234 | - $style = "margin:{$espace}px;" . $style; |
|
| 1234 | + $style = "margin:{$espace}px;".$style; |
|
| 1235 | 1235 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1236 | 1236 | } |
| 1237 | 1237 | |
@@ -1358,7 +1358,7 @@ discard block |
||
| 1358 | 1358 | $image = $valeurs['fichier']; |
| 1359 | 1359 | $format = $valeurs['format_source']; |
| 1360 | 1360 | $destdir = dirname($valeurs['fichier_dest']); |
| 1361 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1361 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1362 | 1362 | |
| 1363 | 1363 | $format_sortie = $valeurs['format_dest']; |
| 1364 | 1364 | |
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | |
| 1391 | 1391 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1392 | 1392 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1393 | - $vignette = $destination . '.' . $format; |
|
| 1393 | + $vignette = $destination.'.'.$format; |
|
| 1394 | 1394 | @copy($image, $vignette); |
| 1395 | 1395 | } |
| 1396 | 1396 | |
@@ -1398,7 +1398,7 @@ discard block |
||
| 1398 | 1398 | include_spip('inc/svg'); |
| 1399 | 1399 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1400 | 1400 | $format_sortie = 'svg'; |
| 1401 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1401 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1402 | 1402 | $valeurs['fichier_dest'] = $vignette; |
| 1403 | 1403 | _image_gd_output($svg, $valeurs); |
| 1404 | 1404 | } |
@@ -1410,9 +1410,9 @@ discard block |
||
| 1410 | 1410 | define('_CONVERT_COMMAND', 'convert'); |
| 1411 | 1411 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1412 | 1412 | if (!defined('_RESIZE_COMMAND')) { |
| 1413 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1413 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1414 | 1414 | } |
| 1415 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1415 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1416 | 1416 | $commande = str_replace( |
| 1417 | 1417 | ['%x', '%y', '%src', '%dest'], |
| 1418 | 1418 | [ |
@@ -1428,7 +1428,7 @@ discard block |
||
| 1428 | 1428 | if (!@file_exists($vignette)) { |
| 1429 | 1429 | spip_log("echec convert sur $vignette"); |
| 1430 | 1430 | |
| 1431 | - return; // echec commande |
|
| 1431 | + return; // echec commande |
|
| 1432 | 1432 | } |
| 1433 | 1433 | } |
| 1434 | 1434 | |
@@ -1445,7 +1445,7 @@ discard block |
||
| 1445 | 1445 | if (!$output) { |
| 1446 | 1446 | return; |
| 1447 | 1447 | } |
| 1448 | - $vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie; |
|
| 1448 | + $vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie; |
|
| 1449 | 1449 | |
| 1450 | 1450 | $imagick = new Imagick(); |
| 1451 | 1451 | $imagick->readImage(realpath($image)); |
@@ -1454,7 +1454,7 @@ discard block |
||
| 1454 | 1454 | $destHeight, |
| 1455 | 1455 | Imagick::FILTER_LANCZOS, |
| 1456 | 1456 | 1 |
| 1457 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1457 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1458 | 1458 | $imagick->writeImage($vignette); |
| 1459 | 1459 | |
| 1460 | 1460 | if (!@file_exists($vignette)) { |
@@ -1463,7 +1463,7 @@ discard block |
||
| 1463 | 1463 | return; |
| 1464 | 1464 | } |
| 1465 | 1465 | // remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester) |
| 1466 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1466 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | 1469 | // netpbm |
@@ -1474,11 +1474,11 @@ discard block |
||
| 1474 | 1474 | if (_PNMSCALE_COMMAND == '') { |
| 1475 | 1475 | return; |
| 1476 | 1476 | } |
| 1477 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1477 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1478 | 1478 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1479 | 1479 | if ($format == 'jpg') { |
| 1480 | 1480 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1481 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1481 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1482 | 1482 | if (!($s = @filesize($vignette))) { |
| 1483 | 1483 | spip_unlink($vignette); |
| 1484 | 1484 | } |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | } else { |
| 1491 | 1491 | if ($format == 'gif') { |
| 1492 | 1492 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1493 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1493 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1494 | 1494 | if (!($s = @filesize($vignette))) { |
| 1495 | 1495 | spip_unlink($vignette); |
| 1496 | 1496 | } |
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | } else { |
| 1503 | 1503 | if ($format == 'png') { |
| 1504 | 1504 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1505 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1505 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1506 | 1506 | if (!($s = @filesize($vignette))) { |
| 1507 | 1507 | spip_unlink($vignette); |
| 1508 | 1508 | } |
@@ -1524,7 +1524,7 @@ discard block |
||
| 1524 | 1524 | return; |
| 1525 | 1525 | } |
| 1526 | 1526 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1527 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1527 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1528 | 1528 | |
| 1529 | 1529 | return; |
| 1530 | 1530 | } |
@@ -1834,7 +1834,7 @@ discard block |
||
| 1834 | 1834 | // de l'image, de facon a tromper le cache du navigateur |
| 1835 | 1835 | // quand on fait supprimer/reuploader un logo |
| 1836 | 1836 | // (pas de filemtime si SAFE MODE) |
| 1837 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1837 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1838 | 1838 | |
| 1839 | 1839 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1840 | 1840 | } |
@@ -1880,7 +1880,7 @@ discard block |
||
| 1880 | 1880 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1881 | 1881 | $intstring = ''; |
| 1882 | 1882 | while ($number > 0) { |
| 1883 | - $intstring = $intstring . chr($number & 255); |
|
| 1883 | + $intstring = $intstring.chr($number & 255); |
|
| 1884 | 1884 | $number >>= 8; |
| 1885 | 1885 | } |
| 1886 | 1886 | |
@@ -1912,9 +1912,9 @@ discard block |
||
| 1912 | 1912 | $b = $argb['blue']; |
| 1913 | 1913 | |
| 1914 | 1914 | if ($bpp[$key] == 32) { |
| 1915 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1915 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1916 | 1916 | } elseif ($bpp[$key] == 24) { |
| 1917 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1917 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1918 | 1918 | } |
| 1919 | 1919 | |
| 1920 | 1920 | if ($a < 128) { |
@@ -1941,48 +1941,48 @@ discard block |
||
| 1941 | 1941 | |
| 1942 | 1942 | // BITMAPINFOHEADER - 40 bytes |
| 1943 | 1943 | $BitmapInfoHeader[$key] = ''; |
| 1944 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1945 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1944 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1945 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1946 | 1946 | // The biHeight member specifies the combined |
| 1947 | 1947 | // height of the XOR and AND masks. |
| 1948 | 1948 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1949 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1950 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1951 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1952 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1953 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1954 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1955 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1956 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1949 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1950 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1951 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1952 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1953 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1954 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1955 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1956 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1957 | 1957 | } |
| 1958 | 1958 | |
| 1959 | 1959 | |
| 1960 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1961 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1962 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1960 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1961 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1962 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1963 | 1963 | |
| 1964 | 1964 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1965 | 1965 | foreach ($gd_image_array as $key => $gd_image) { |
| 1966 | 1966 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1967 | 1967 | |
| 1968 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1969 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1970 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1971 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1968 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1969 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1970 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1971 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1972 | 1972 | |
| 1973 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1974 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1973 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1974 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1975 | 1975 | |
| 1976 | 1976 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1977 | 1977 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1978 | 1978 | $dwBytesInRes, |
| 1979 | 1979 | 4 |
| 1980 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1980 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1981 | 1981 | |
| 1982 | 1982 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1983 | 1983 | $dwImageOffset, |
| 1984 | 1984 | 4 |
| 1985 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1985 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1986 | 1986 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1987 | 1987 | $dwImageOffset += strlen($icXOR[$key]); |
| 1988 | 1988 | $dwImageOffset += strlen($icAND[$key]); |