Completed
Push — master ( 716202...2bdd49 )
by cam
01:00
created
ecrire/inc/filtres_images_lib_mini.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,7 +1420,7 @@  discard block
 block discarded – undo
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
 
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
 		if (!$output) {
1439 1439
 			return;
1440 1440
 		}
1441
-		$vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie;
1441
+		$vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie;
1442 1442
 
1443 1443
 		$imagick = new Imagick();
1444 1444
 		$imagick->readImage(realpath($image));
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
 			$destHeight,
1448 1448
 			Imagick::FILTER_LANCZOS,
1449 1449
 			1
1450
-		);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1450
+		); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1451 1451
 		$imagick->writeImage($vignette);
1452 1452
 
1453 1453
 		if (!@file_exists($vignette)) {
@@ -1456,7 +1456,7 @@  discard block
 block discarded – undo
1456 1456
 			return;
1457 1457
 		}
1458 1458
 		// remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester)
1459
-		$vignette = $destination . '.' . $format_sortie;
1459
+		$vignette = $destination.'.'.$format_sortie;
1460 1460
 	}
1461 1461
 
1462 1462
 	// netpbm
@@ -1467,11 +1467,11 @@  discard block
 block discarded – undo
1467 1467
 		if (_PNMSCALE_COMMAND == '') {
1468 1468
 			return;
1469 1469
 		}
1470
-		$vignette = $destination . '.' . $format_sortie;
1470
+		$vignette = $destination.'.'.$format_sortie;
1471 1471
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND);
1472 1472
 		if ($format == 'jpg') {
1473 1473
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND);
1474
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1474
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1475 1475
 			if (!($s = @filesize($vignette))) {
1476 1476
 				spip_unlink($vignette);
1477 1477
 			}
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
 		} else {
1484 1484
 			if ($format == 'gif') {
1485 1485
 				$giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND);
1486
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1486
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1487 1487
 				if (!($s = @filesize($vignette))) {
1488 1488
 					spip_unlink($vignette);
1489 1489
 				}
@@ -1495,7 +1495,7 @@  discard block
 block discarded – undo
1495 1495
 			} else {
1496 1496
 				if ($format == 'png') {
1497 1497
 					$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND);
1498
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1498
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1499 1499
 					if (!($s = @filesize($vignette))) {
1500 1500
 						spip_unlink($vignette);
1501 1501
 					}
@@ -1517,7 +1517,7 @@  discard block
 block discarded – undo
1517 1517
 			return;
1518 1518
 		}
1519 1519
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1520
-			spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels');
1520
+			spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels');
1521 1521
 
1522 1522
 			return;
1523 1523
 		}
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 		// de l'image, de facon a tromper le cache du navigateur
1830 1830
 		// quand on fait supprimer/reuploader un logo
1831 1831
 		// (pas de filemtime si SAFE MODE)
1832
-		$date = test_espace_prive() ? ('?' . $date) : '';
1832
+		$date = test_espace_prive() ? ('?'.$date) : '';
1833 1833
 
1834 1834
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1835 1835
 	}
@@ -1875,7 +1875,7 @@  discard block
 block discarded – undo
1875 1875
 	public static function LittleEndian2String($number, $minbytes = 1) {
1876 1876
 		$intstring = '';
1877 1877
 		while ($number > 0) {
1878
-			$intstring = $intstring . chr($number & 255);
1878
+			$intstring = $intstring.chr($number & 255);
1879 1879
 			$number >>= 8;
1880 1880
 		}
1881 1881
 
@@ -1907,9 +1907,9 @@  discard block
 block discarded – undo
1907 1907
 					$b = $argb['blue'];
1908 1908
 
1909 1909
 					if ($bpp[$key] == 32) {
1910
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1910
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1911 1911
 					} elseif ($bpp[$key] == 24) {
1912
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1912
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1913 1913
 					}
1914 1914
 
1915 1915
 					if ($a < 128) {
@@ -1936,48 +1936,48 @@  discard block
 block discarded – undo
1936 1936
 
1937 1937
 			// BITMAPINFOHEADER - 40 bytes
1938 1938
 			$BitmapInfoHeader[$key] = '';
1939
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1940
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1939
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1940
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1941 1941
 			// The biHeight member specifies the combined
1942 1942
 			// height of the XOR and AND masks.
1943 1943
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1944
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1945
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1946
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1947
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1948
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1949
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1950
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1951
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1944
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1945
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1946
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1947
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1948
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1949
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1950
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1951
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1952 1952
 		}
1953 1953
 
1954 1954
 
1955
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1956
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1957
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1955
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1956
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1957
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1958 1958
 
1959 1959
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1960 1960
 		foreach ($gd_image_array as $key => $gd_image) {
1961 1961
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1962 1962
 
1963
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1964
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1965
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1966
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1963
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1964
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1965
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1966
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1967 1967
 
1968
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1969
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1968
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1969
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1970 1970
 
1971 1971
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1972 1972
 			$icondata .= phpthumb_functions::LittleEndian2String(
1973 1973
 				$dwBytesInRes,
1974 1974
 				4
1975
-			);     // dwBytesInRes;	// How many bytes in this resource?
1975
+			); // dwBytesInRes;	// How many bytes in this resource?
1976 1976
 
1977 1977
 			$icondata .= phpthumb_functions::LittleEndian2String(
1978 1978
 				$dwImageOffset,
1979 1979
 				4
1980
-			);    // dwImageOffset;   // Where in the file is this image?
1980
+			); // dwImageOffset;   // Where in the file is this image?
1981 1981
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1982 1982
 			$dwImageOffset += strlen($icXOR[$key]);
1983 1983
 			$dwImageOffset += strlen($icAND[$key]);
Please login to merge, or discard this patch.