@@ -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"; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $couleur = couleur_html_to_hex($couleur); |
| 68 | 68 | $couleur = ltrim($couleur, '#'); |
| 69 | 69 | if (strlen($couleur) === 3) { |
| 70 | - $couleur = $couleur[0] . $couleur[0] . $couleur[1] . $couleur[1] . $couleur[2] . $couleur[2]; |
|
| 70 | + $couleur = $couleur[0].$couleur[0].$couleur[1].$couleur[1].$couleur[2].$couleur[2]; |
|
| 71 | 71 | } |
| 72 | 72 | $retour = []; |
| 73 | 73 | $retour['red'] = hexdec(substr($couleur, 0, 2)); |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | $var_G = ($G / 255); |
| 126 | 126 | $var_B = ($B / 255); |
| 127 | 127 | |
| 128 | - $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | - $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | - $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 128 | + $var_Min = min($var_R, $var_G, $var_B); //Min. value of RGB |
|
| 129 | + $var_Max = max($var_R, $var_G, $var_B); //Max. value of RGB |
|
| 130 | + $del_Max = $var_Max - $var_Min; //Delta RGB value |
|
| 131 | 131 | |
| 132 | 132 | $L = ($var_Max + $var_Min) / 2; |
| 133 | 133 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | function _couleur_hsl_to_rgb($H, $S, $L) { |
| 191 | 191 | // helper |
| 192 | - $hue_2_rgb = function ($v1, $v2, $vH) { |
|
| 192 | + $hue_2_rgb = function($v1, $v2, $vH) { |
|
| 193 | 193 | if ($vH < 0) { |
| 194 | 194 | $vH += 1; |
| 195 | 195 | } |
@@ -321,11 +321,11 @@ discard block |
||
| 321 | 321 | $img = "<img src='$source' />"; |
| 322 | 322 | } elseif ( |
| 323 | 323 | preg_match('@^data:image/([^;]*);base64,(.*)$@isS', $source, $regs) |
| 324 | - and $extension = _image_trouver_extension_depuis_mime('image/' . $regs[1]) |
|
| 324 | + and $extension = _image_trouver_extension_depuis_mime('image/'.$regs[1]) |
|
| 325 | 325 | and in_array($extension, _image_extensions_acceptees_en_entree()) |
| 326 | 326 | ) { |
| 327 | 327 | # gerer img src="data:....base64" |
| 328 | - $local = sous_repertoire(_DIR_VAR, 'image-data') . md5($regs[2]) . '.' . _image_extension_normalisee($extension); |
|
| 328 | + $local = sous_repertoire(_DIR_VAR, 'image-data').md5($regs[2]).'.'._image_extension_normalisee($extension); |
|
| 329 | 329 | if (!file_exists($local)) { |
| 330 | 330 | ecrire_fichier($local, base64_decode($regs[2])); |
| 331 | 331 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | // les protocoles web prennent au moins 3 lettres |
| 343 | 343 | if (tester_url_absolue($source)) { |
| 344 | 344 | include_spip('inc/distant'); |
| 345 | - $fichier = _DIR_RACINE . copie_locale($source); |
|
| 345 | + $fichier = _DIR_RACINE.copie_locale($source); |
|
| 346 | 346 | if (!$fichier) { |
| 347 | 347 | return ''; |
| 348 | 348 | } |
@@ -440,9 +440,9 @@ discard block |
||
| 440 | 440 | // on garde la terminaison initiale car image simplement copiee |
| 441 | 441 | // et on postfixe son nom avec un md5 du path |
| 442 | 442 | $terminaison_dest = $terminaison; |
| 443 | - $fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5); |
|
| 443 | + $fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5); |
|
| 444 | 444 | } else { |
| 445 | - $fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5); |
|
| 445 | + $fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5); |
|
| 446 | 446 | } |
| 447 | 447 | $cache = sous_repertoire(_DIR_VAR, $cache); |
| 448 | 448 | $cache = sous_repertoire($cache, $effet); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $fichier_dest = substr($fichier_dest, 2); |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | - $fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest; |
|
| 456 | + $fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest; |
|
| 457 | 457 | |
| 458 | 458 | $GLOBALS['images_calculees'][] = $fichier_dest; |
| 459 | 459 | |
@@ -491,15 +491,15 @@ discard block |
||
| 491 | 491 | |
| 492 | 492 | if ($creer) { |
| 493 | 493 | spip_log( |
| 494 | - 'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier", |
|
| 495 | - 'images' . _LOG_DEBUG |
|
| 494 | + 'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier", |
|
| 495 | + 'images'._LOG_DEBUG |
|
| 496 | 496 | ); |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | $term_fonction = _image_trouver_extension_pertinente($fichier); |
| 500 | - $ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction; |
|
| 500 | + $ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction; |
|
| 501 | 501 | $ret['fichier'] = $fichier; |
| 502 | - $ret['fonction_image'] = '_image_image' . $terminaison_dest; |
|
| 502 | + $ret['fonction_image'] = '_image_image'.$terminaison_dest; |
|
| 503 | 503 | $ret['fichier_dest'] = $fichier_dest; |
| 504 | 504 | $ret['format_source'] = _image_extension_normalisee($terminaison); |
| 505 | 505 | $ret['format_dest'] = $terminaison_dest; |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | |
| 649 | 649 | $_terminaison = _image_trouver_extension_depuis_mime($mime); |
| 650 | 650 | if ($_terminaison and $_terminaison !== $terminaison) { |
| 651 | - spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE); |
|
| 651 | + spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE); |
|
| 652 | 652 | $terminaison = $_terminaison; |
| 653 | 653 | } |
| 654 | 654 | return $terminaison; |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | if (!function_exists('imagepng')) { |
| 806 | 806 | return false; |
| 807 | 807 | } |
| 808 | - $tmp = $fichier . '.tmp'; |
|
| 808 | + $tmp = $fichier.'.tmp'; |
|
| 809 | 809 | $ret = imagepng($img, $tmp); |
| 810 | 810 | if (file_exists($tmp)) { |
| 811 | 811 | $taille_test = getimagesize($tmp); |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | if (!function_exists('imagegif')) { |
| 841 | 841 | return false; |
| 842 | 842 | } |
| 843 | - $tmp = $fichier . '.tmp'; |
|
| 843 | + $tmp = $fichier.'.tmp'; |
|
| 844 | 844 | $ret = imagegif($img, $tmp); |
| 845 | 845 | if (file_exists($tmp)) { |
| 846 | 846 | $taille_test = getimagesize($tmp); |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | if (!function_exists('imagejpeg')) { |
| 881 | 881 | return false; |
| 882 | 882 | } |
| 883 | - $tmp = $fichier . '.tmp'; |
|
| 883 | + $tmp = $fichier.'.tmp'; |
|
| 884 | 884 | |
| 885 | 885 | // Enable interlancing |
| 886 | 886 | imageinterlace($img, true); |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | if (!function_exists('imagewebp')) { |
| 942 | 942 | return false; |
| 943 | 943 | } |
| 944 | - $tmp = $fichier . '.tmp'; |
|
| 944 | + $tmp = $fichier.'.tmp'; |
|
| 945 | 945 | $ret = imagewebp($img, $tmp, $qualite); |
| 946 | 946 | if (file_exists($tmp)) { |
| 947 | 947 | $taille_test = getimagesize($tmp); |
@@ -975,7 +975,7 @@ discard block |
||
| 975 | 975 | */ |
| 976 | 976 | function _image_imagesvg($img, $fichier) { |
| 977 | 977 | |
| 978 | - $tmp = $fichier . '.tmp'; |
|
| 978 | + $tmp = $fichier.'.tmp'; |
|
| 979 | 979 | if (strpos($img, '<') === false) { |
| 980 | 980 | $img = supprimer_timestamp($img); |
| 981 | 981 | if (!file_exists($img)) { |
@@ -1032,13 +1032,13 @@ discard block |
||
| 1032 | 1032 | */ |
| 1033 | 1033 | function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) { |
| 1034 | 1034 | if (is_null($fonction)) { |
| 1035 | - $fonction = '_image_image' . $valeurs['format_dest']; |
|
| 1035 | + $fonction = '_image_image'.$valeurs['format_dest']; |
|
| 1036 | 1036 | } |
| 1037 | 1037 | $ret = false; |
| 1038 | 1038 | #un flag pour reperer les images gravees |
| 1039 | 1039 | $lock = |
| 1040 | 1040 | !statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout |
| 1041 | - or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src')); |
|
| 1041 | + or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src')); |
|
| 1042 | 1042 | if ( |
| 1043 | 1043 | function_exists($fonction) |
| 1044 | 1044 | && ($ret = $fonction($img, $valeurs['fichier_dest'], $qualite)) # on a reussi a creer l'image |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | // dans tous les cas mettre a jour la taille de l'image finale |
| 1050 | 1050 | [$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']); |
| 1051 | 1051 | $valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition |
| 1052 | - ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true); |
|
| 1052 | + ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true); |
|
| 1053 | 1053 | } |
| 1054 | 1054 | } |
| 1055 | 1055 | |
@@ -1224,7 +1224,7 @@ discard block |
||
| 1224 | 1224 | |
| 1225 | 1225 | // attributs deprecies. Transformer en CSS |
| 1226 | 1226 | if ($espace = extraire_attribut($tag, 'hspace')) { |
| 1227 | - $style = "margin:${espace}px;" . $style; |
|
| 1227 | + $style = "margin:${espace}px;".$style; |
|
| 1228 | 1228 | $tag = inserer_attribut($tag, 'hspace', ''); |
| 1229 | 1229 | } |
| 1230 | 1230 | |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | $image = $valeurs['fichier']; |
| 1352 | 1352 | $format = $valeurs['format_source']; |
| 1353 | 1353 | $destdir = dirname($valeurs['fichier_dest']); |
| 1354 | - $destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']); |
|
| 1354 | + $destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']); |
|
| 1355 | 1355 | |
| 1356 | 1356 | $format_sortie = $valeurs['format_dest']; |
| 1357 | 1357 | |
@@ -1383,14 +1383,14 @@ discard block |
||
| 1383 | 1383 | |
| 1384 | 1384 | // Si l'image est de la taille demandee (ou plus petite), simplement la retourner |
| 1385 | 1385 | if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) { |
| 1386 | - $vignette = $destination . '.' . $format; |
|
| 1386 | + $vignette = $destination.'.'.$format; |
|
| 1387 | 1387 | @copy($image, $vignette); |
| 1388 | 1388 | } |
| 1389 | 1389 | |
| 1390 | 1390 | elseif ($valeurs['format_source'] === 'svg') { |
| 1391 | 1391 | if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) { |
| 1392 | 1392 | $format_sortie = 'svg'; |
| 1393 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1393 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1394 | 1394 | $valeurs['fichier_dest'] = $vignette; |
| 1395 | 1395 | _image_gd_output($svg, $valeurs); |
| 1396 | 1396 | } |
@@ -1402,9 +1402,9 @@ discard block |
||
| 1402 | 1402 | define('_CONVERT_COMMAND', 'convert'); |
| 1403 | 1403 | } // Securite : mes_options.php peut preciser le chemin absolu |
| 1404 | 1404 | if (!defined('_RESIZE_COMMAND')) { |
| 1405 | - define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -resize %xx%y! %src %dest'); |
|
| 1405 | + define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -resize %xx%y! %src %dest'); |
|
| 1406 | 1406 | } |
| 1407 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1407 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1408 | 1408 | $commande = str_replace( |
| 1409 | 1409 | ['%x', '%y', '%src', '%dest'], |
| 1410 | 1410 | [ |
@@ -1420,13 +1420,13 @@ discard block |
||
| 1420 | 1420 | if (!@file_exists($vignette)) { |
| 1421 | 1421 | spip_log("echec convert sur $vignette"); |
| 1422 | 1422 | |
| 1423 | - return; // echec commande |
|
| 1423 | + return; // echec commande |
|
| 1424 | 1424 | } |
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | 1427 | // php5 imagemagick |
| 1428 | 1428 | elseif ($process == 'imagick') { |
| 1429 | - $vignette = "$destination." . $format_sortie; |
|
| 1429 | + $vignette = "$destination.".$format_sortie; |
|
| 1430 | 1430 | |
| 1431 | 1431 | if (!class_exists(\Imagick::class)) { |
| 1432 | 1432 | spip_log('Classe Imagick absente !', _LOG_ERREUR); |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | $destHeight, |
| 1441 | 1441 | Imagick::FILTER_LANCZOS, |
| 1442 | 1442 | 1 |
| 1443 | - );//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1443 | + ); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100); |
|
| 1444 | 1444 | $imagick->writeImage(realpath($vignette)); |
| 1445 | 1445 | |
| 1446 | 1446 | if (!@file_exists($vignette)) { |
@@ -1458,11 +1458,11 @@ discard block |
||
| 1458 | 1458 | if (_PNMSCALE_COMMAND == '') { |
| 1459 | 1459 | return; |
| 1460 | 1460 | } |
| 1461 | - $vignette = $destination . '.' . $format_sortie; |
|
| 1461 | + $vignette = $destination.'.'.$format_sortie; |
|
| 1462 | 1462 | $pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND); |
| 1463 | 1463 | if ($format == 'jpg') { |
| 1464 | 1464 | $jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND); |
| 1465 | - exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1465 | + exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1466 | 1466 | if (!($s = @filesize($vignette))) { |
| 1467 | 1467 | spip_unlink($vignette); |
| 1468 | 1468 | } |
@@ -1474,7 +1474,7 @@ discard block |
||
| 1474 | 1474 | } else { |
| 1475 | 1475 | if ($format == 'gif') { |
| 1476 | 1476 | $giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND); |
| 1477 | - exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1477 | + exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1478 | 1478 | if (!($s = @filesize($vignette))) { |
| 1479 | 1479 | spip_unlink($vignette); |
| 1480 | 1480 | } |
@@ -1486,7 +1486,7 @@ discard block |
||
| 1486 | 1486 | } else { |
| 1487 | 1487 | if ($format == 'png') { |
| 1488 | 1488 | $pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND); |
| 1489 | - exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1489 | + exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette"); |
|
| 1490 | 1490 | if (!($s = @filesize($vignette))) { |
| 1491 | 1491 | spip_unlink($vignette); |
| 1492 | 1492 | } |
@@ -1508,7 +1508,7 @@ discard block |
||
| 1508 | 1508 | return; |
| 1509 | 1509 | } |
| 1510 | 1510 | if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) { |
| 1511 | - spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels'); |
|
| 1511 | + spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels'); |
|
| 1512 | 1512 | |
| 1513 | 1513 | return; |
| 1514 | 1514 | } |
@@ -1820,7 +1820,7 @@ discard block |
||
| 1820 | 1820 | // de l'image, de facon a tromper le cache du navigateur |
| 1821 | 1821 | // quand on fait supprimer/reuploader un logo |
| 1822 | 1822 | // (pas de filemtime si SAFE MODE) |
| 1823 | - $date = test_espace_prive() ? ('?' . $date) : ''; |
|
| 1823 | + $date = test_espace_prive() ? ('?'.$date) : ''; |
|
| 1824 | 1824 | |
| 1825 | 1825 | return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]); |
| 1826 | 1826 | } |
@@ -1866,7 +1866,7 @@ discard block |
||
| 1866 | 1866 | public static function LittleEndian2String($number, $minbytes = 1) { |
| 1867 | 1867 | $intstring = ''; |
| 1868 | 1868 | while ($number > 0) { |
| 1869 | - $intstring = $intstring . chr($number & 255); |
|
| 1869 | + $intstring = $intstring.chr($number & 255); |
|
| 1870 | 1870 | $number >>= 8; |
| 1871 | 1871 | } |
| 1872 | 1872 | |
@@ -1898,9 +1898,9 @@ discard block |
||
| 1898 | 1898 | $b = $argb['blue']; |
| 1899 | 1899 | |
| 1900 | 1900 | if ($bpp[$key] == 32) { |
| 1901 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a); |
|
| 1901 | + $icXOR[$key] .= chr($b).chr($g).chr($r).chr($a); |
|
| 1902 | 1902 | } elseif ($bpp[$key] == 24) { |
| 1903 | - $icXOR[$key] .= chr($b) . chr($g) . chr($r); |
|
| 1903 | + $icXOR[$key] .= chr($b).chr($g).chr($r); |
|
| 1904 | 1904 | } |
| 1905 | 1905 | |
| 1906 | 1906 | if ($a < 128) { |
@@ -1927,48 +1927,48 @@ discard block |
||
| 1927 | 1927 | |
| 1928 | 1928 | // BITMAPINFOHEADER - 40 bytes |
| 1929 | 1929 | $BitmapInfoHeader[$key] = ''; |
| 1930 | - $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1931 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1930 | + $BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD biSize; |
|
| 1931 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG biWidth; |
|
| 1932 | 1932 | // The biHeight member specifies the combined |
| 1933 | 1933 | // height of the XOR and AND masks. |
| 1934 | 1934 | $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG biHeight; |
| 1935 | - $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1936 | - $BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00"; // wBitCount; |
|
| 1937 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1938 | - $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1939 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1940 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1941 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1942 | - $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1935 | + $BitmapInfoHeader[$key] .= "\x01\x00"; // WORD biPlanes; |
|
| 1936 | + $BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount; |
|
| 1937 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biCompression; |
|
| 1938 | + $BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD biSizeImage; |
|
| 1939 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biXPelsPerMeter; |
|
| 1940 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG biYPelsPerMeter; |
|
| 1941 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrUsed; |
|
| 1942 | + $BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD biClrImportant; |
|
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | 1945 | |
| 1946 | - $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1947 | - $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1948 | - $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1946 | + $icondata = "\x00\x00"; // idReserved; // Reserved (must be 0) |
|
| 1947 | + $icondata .= "\x01\x00"; // idType; // Resource Type (1 for icons) |
|
| 1948 | + $icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount; // How many images? |
|
| 1949 | 1949 | |
| 1950 | 1950 | $dwImageOffset = 6 + (count($gd_image_array) * 16); |
| 1951 | 1951 | foreach ($gd_image_array as $key => $gd_image) { |
| 1952 | 1952 | // ICONDIRENTRY idEntries[1]; // An entry for each image (idCount of 'em) |
| 1953 | 1953 | |
| 1954 | - $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1955 | - $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1956 | - $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1957 | - $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1954 | + $icondata .= chr($ImageWidths[$key]); // bWidth; // Width, in pixels, of the image |
|
| 1955 | + $icondata .= chr($ImageHeights[$key]); // bHeight; // Height, in pixels, of the image |
|
| 1956 | + $icondata .= chr($totalcolors[$key]); // bColorCount; // Number of colors in image (0 if >=8bpp) |
|
| 1957 | + $icondata .= "\x00"; // bReserved; // Reserved ( must be 0) |
|
| 1958 | 1958 | |
| 1959 | - $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1960 | - $icondata .= chr($bpp[$key]) . "\x00"; // wBitCount; // Bits per pixel |
|
| 1959 | + $icondata .= "\x01\x00"; // wPlanes; // Color Planes |
|
| 1960 | + $icondata .= chr($bpp[$key])."\x00"; // wBitCount; // Bits per pixel |
|
| 1961 | 1961 | |
| 1962 | 1962 | $dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]); |
| 1963 | 1963 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1964 | 1964 | $dwBytesInRes, |
| 1965 | 1965 | 4 |
| 1966 | - ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1966 | + ); // dwBytesInRes; // How many bytes in this resource? |
|
| 1967 | 1967 | |
| 1968 | 1968 | $icondata .= phpthumb_functions::LittleEndian2String( |
| 1969 | 1969 | $dwImageOffset, |
| 1970 | 1970 | 4 |
| 1971 | - ); // dwImageOffset; // Where in the file is this image? |
|
| 1971 | + ); // dwImageOffset; // Where in the file is this image? |
|
| 1972 | 1972 | $dwImageOffset += strlen($BitmapInfoHeader[$key]); |
| 1973 | 1973 | $dwImageOffset += strlen($icXOR[$key]); |
| 1974 | 1974 | $dwImageOffset += strlen($icAND[$key]); |