Completed
Push — master ( 51fdd6...68a7da )
by cam
01:22
created
ecrire/inc/filtres_images_lib_mini.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 	$blue = dechex($blue);
43 43
 
44 44
 	if (strlen($red) == 1) {
45
-		$red = '0' . $red;
45
+		$red = '0'.$red;
46 46
 	}
47 47
 	if (strlen($green) == 1) {
48
-		$green = '0' . $green;
48
+		$green = '0'.$green;
49 49
 	}
50 50
 	if (strlen($blue) == 1) {
51
-		$blue = '0' . $blue;
51
+		$blue = '0'.$blue;
52 52
 	}
53 53
 
54 54
 	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
 		}
@@ -444,9 +444,9 @@  discard block
 block discarded – undo
444 444
 			// on garde la terminaison initiale car image simplement copiee
445 445
 			// et on postfixe son nom avec un md5 du path
446 446
 			$terminaison_dest = $terminaison;
447
-			$fichier_dest .= '-' . substr(md5("$identifiant"), 0, 5);
447
+			$fichier_dest .= '-'.substr(md5("$identifiant"), 0, 5);
448 448
 		} else {
449
-			$fichier_dest .= '-' . substr(md5("$identifiant-$effet"), 0, 5);
449
+			$fichier_dest .= '-'.substr(md5("$identifiant-$effet"), 0, 5);
450 450
 		}
451 451
 		$cache = sous_repertoire(_DIR_VAR, $cache);
452 452
 		$cache = sous_repertoire($cache, $effet);
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
 		$fichier_dest = substr($fichier_dest, 2);
458 458
 	}
459 459
 
460
-	$fichier_dest = $cache . $fichier_dest . '.' . $terminaison_dest;
460
+	$fichier_dest = $cache.$fichier_dest.'.'.$terminaison_dest;
461 461
 
462 462
 	$GLOBALS['images_calculees'][] = $fichier_dest;
463 463
 
@@ -495,15 +495,15 @@  discard block
 block discarded – undo
495 495
 
496 496
 	if ($creer) {
497 497
 		spip_log(
498
-			'filtre image ' . ($fonction_creation ? reset($fonction_creation) : '') . "[$effet] sur $fichier",
499
-			'images' . _LOG_DEBUG
498
+			'filtre image '.($fonction_creation ? reset($fonction_creation) : '')."[$effet] sur $fichier",
499
+			'images'._LOG_DEBUG
500 500
 		);
501 501
 	}
502 502
 
503 503
 	$term_fonction = _image_trouver_extension_pertinente($fichier);
504
-	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom' . $term_fonction;
504
+	$ret['fonction_imagecreatefrom'] = '_imagecreatefrom'.$term_fonction;
505 505
 	$ret['fichier'] = $fichier;
506
-	$ret['fonction_image'] = '_image_image' . $terminaison_dest;
506
+	$ret['fonction_image'] = '_image_image'.$terminaison_dest;
507 507
 	$ret['fichier_dest'] = $fichier_dest;
508 508
 	$ret['format_source'] = _image_extension_normalisee($terminaison);
509 509
 	$ret['format_dest'] = $terminaison_dest;
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 
654 654
 	$_terminaison = _image_trouver_extension_depuis_mime($mime);
655 655
 	if ($_terminaison and $_terminaison !== $terminaison) {
656
-		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.' . _LOG_INFO_IMPORTANTE);
656
+		spip_log("Mauvaise extension du fichier : $path . Son type mime est : $mime", 'images.'._LOG_INFO_IMPORTANTE);
657 657
 		$terminaison = $_terminaison;
658 658
 	}
659 659
 	return $terminaison;
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 	if (!function_exists('imagepng')) {
811 811
 		return false;
812 812
 	}
813
-	$tmp = $fichier . '.tmp';
813
+	$tmp = $fichier.'.tmp';
814 814
 	$ret = imagepng($img, $tmp);
815 815
 	if (file_exists($tmp)) {
816 816
 		$taille_test = @getimagesize($tmp);
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
 	if (!function_exists('imagegif')) {
846 846
 		return false;
847 847
 	}
848
-	$tmp = $fichier . '.tmp';
848
+	$tmp = $fichier.'.tmp';
849 849
 	$ret = imagegif($img, $tmp);
850 850
 	if (file_exists($tmp)) {
851 851
 		$taille_test = @getimagesize($tmp);
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 	if (!function_exists('imagejpeg')) {
886 886
 		return false;
887 887
 	}
888
-	$tmp = $fichier . '.tmp';
888
+	$tmp = $fichier.'.tmp';
889 889
 
890 890
 	// Enable interlancing
891 891
 	imageinterlace($img, true);
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 	if (!function_exists('imagewebp')) {
947 947
 		return false;
948 948
 	}
949
-	$tmp = $fichier . '.tmp';
949
+	$tmp = $fichier.'.tmp';
950 950
 	$ret = imagewebp($img, $tmp, $qualite);
951 951
 	if (file_exists($tmp)) {
952 952
 		$taille_test = @getimagesize($tmp);
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
  */
981 981
 function _image_imagesvg($img, $fichier) {
982 982
 
983
-	$tmp = $fichier . '.tmp';
983
+	$tmp = $fichier.'.tmp';
984 984
 	if (strpos($img, '<') === false) {
985 985
 		$img = supprimer_timestamp($img);
986 986
 		if (!file_exists($img)) {
@@ -1037,13 +1037,13 @@  discard block
 block discarded – undo
1037 1037
  */
1038 1038
 function _image_gd_output($img, $valeurs, $qualite = _IMG_GD_QUALITE, $fonction = null) {
1039 1039
 	if (is_null($fonction)) {
1040
-		$fonction = '_image_image' . $valeurs['format_dest'];
1040
+		$fonction = '_image_image'.$valeurs['format_dest'];
1041 1041
 	}
1042 1042
 	$ret = false;
1043 1043
 	#un flag pour reperer les images gravees
1044 1044
 	$lock = (
1045 1045
 		!statut_effacer_images_temporaires('get') // si la fonction n'a pas ete activee, on grave tout
1046
-		or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'] . '.src'))
1046
+		or (@file_exists($valeurs['fichier_dest']) and !@file_exists($valeurs['fichier_dest'].'.src'))
1047 1047
 	);
1048 1048
 	if (
1049 1049
 		function_exists($fonction)
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 			// dans tous les cas mettre a jour la taille de l'image finale
1056 1056
 			[$valeurs['hauteur_dest'], $valeurs['largeur_dest']] = taille_image($valeurs['fichier_dest']);
1057 1057
 			$valeurs['date'] = @filemtime($valeurs['fichier_dest']); // pour la retrouver apres disparition
1058
-			ecrire_fichier($valeurs['fichier_dest'] . '.src', serialize($valeurs), true);
1058
+			ecrire_fichier($valeurs['fichier_dest'].'.src', serialize($valeurs), true);
1059 1059
 		}
1060 1060
 	}
1061 1061
 
@@ -1230,7 +1230,7 @@  discard block
 block discarded – undo
1230 1230
 
1231 1231
 	// attributs deprecies. Transformer en CSS
1232 1232
 	if ($espace = extraire_attribut($tag, 'hspace')) {
1233
-		$style = "margin:{$espace}px;" . $style;
1233
+		$style = "margin:{$espace}px;".$style;
1234 1234
 		$tag = inserer_attribut($tag, 'hspace', '');
1235 1235
 	}
1236 1236
 
@@ -1357,7 +1357,7 @@  discard block
 block discarded – undo
1357 1357
 	$image = $valeurs['fichier'];
1358 1358
 	$format = $valeurs['format_source'];
1359 1359
 	$destdir = dirname($valeurs['fichier_dest']);
1360
-	$destfile = basename($valeurs['fichier_dest'], '.' . $valeurs['format_dest']);
1360
+	$destfile = basename($valeurs['fichier_dest'], '.'.$valeurs['format_dest']);
1361 1361
 
1362 1362
 	$format_sortie = $valeurs['format_dest'];
1363 1363
 
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 
1390 1390
 	// Si l'image est de la taille demandee (ou plus petite), simplement la retourner
1391 1391
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1392
-		$vignette = $destination . '.' . $format;
1392
+		$vignette = $destination.'.'.$format;
1393 1393
 		@copy($image, $vignette);
1394 1394
 	}
1395 1395
 
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
 		include_spip('inc/svg');
1398 1398
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1399 1399
 			$format_sortie = 'svg';
1400
-			$vignette = $destination . '.' . $format_sortie;
1400
+			$vignette = $destination.'.'.$format_sortie;
1401 1401
 			$valeurs['fichier_dest'] = $vignette;
1402 1402
 			_image_gd_output($svg, $valeurs);
1403 1403
 		}
@@ -1409,9 +1409,9 @@  discard block
 block discarded – undo
1409 1409
 			define('_CONVERT_COMMAND', 'convert');
1410 1410
 		} // Securite : mes_options.php peut preciser le chemin absolu
1411 1411
 		if (!defined('_RESIZE_COMMAND')) {
1412
-			define('_RESIZE_COMMAND', _CONVERT_COMMAND . ' -quality ' . _IMG_CONVERT_QUALITE . ' -orient Undefined -resize %xx%y! %src %dest');
1412
+			define('_RESIZE_COMMAND', _CONVERT_COMMAND.' -quality '._IMG_CONVERT_QUALITE.' -orient Undefined -resize %xx%y! %src %dest');
1413 1413
 		}
1414
-		$vignette = $destination . '.' . $format_sortie;
1414
+		$vignette = $destination.'.'.$format_sortie;
1415 1415
 		$commande = str_replace(
1416 1416
 			['%x', '%y', '%src', '%dest'],
1417 1417
 			[
@@ -1427,7 +1427,7 @@  discard block
 block discarded – undo
1427 1427
 		if (!@file_exists($vignette)) {
1428 1428
 			spip_log("echec convert sur $vignette");
1429 1429
 
1430
-			return;  // echec commande
1430
+			return; // echec commande
1431 1431
 		}
1432 1432
 	}
1433 1433
 
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
 		if (!$output) {
1445 1445
 			return;
1446 1446
 		}
1447
-		$vignette = $output . DIRECTORY_SEPARATOR . basename($destination) . '.' . $format_sortie;
1447
+		$vignette = $output.DIRECTORY_SEPARATOR.basename($destination).'.'.$format_sortie;
1448 1448
 
1449 1449
 		$imagick = new Imagick();
1450 1450
 		$imagick->readImage(realpath($image));
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
 			$destHeight,
1454 1454
 			Imagick::FILTER_LANCZOS,
1455 1455
 			1
1456
-		);//, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1456
+		); //, IMAGICK_FILTER_LANCZOS, _IMG_IMAGICK_QUALITE / 100);
1457 1457
 		$imagick->writeImage($vignette);
1458 1458
 
1459 1459
 		if (!@file_exists($vignette)) {
@@ -1462,7 +1462,7 @@  discard block
 block discarded – undo
1462 1462
 			return;
1463 1463
 		}
1464 1464
 		// remettre le chemin relatif car c'est ce qu'attend SPIP pour la suite (en particlier action/tester)
1465
-		$vignette = $destination . '.' . $format_sortie;
1465
+		$vignette = $destination.'.'.$format_sortie;
1466 1466
 	}
1467 1467
 
1468 1468
 	// netpbm
@@ -1473,11 +1473,11 @@  discard block
 block discarded – undo
1473 1473
 		if (_PNMSCALE_COMMAND == '') {
1474 1474
 			return;
1475 1475
 		}
1476
-		$vignette = $destination . '.' . $format_sortie;
1476
+		$vignette = $destination.'.'.$format_sortie;
1477 1477
 		$pnmtojpeg_command = str_replace('pnmscale', 'pnmtojpeg', _PNMSCALE_COMMAND);
1478 1478
 		if ($format == 'jpg') {
1479 1479
 			$jpegtopnm_command = str_replace('pnmscale', 'jpegtopnm', _PNMSCALE_COMMAND);
1480
-			exec("$jpegtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1480
+			exec("$jpegtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1481 1481
 			if (!($s = @filesize($vignette))) {
1482 1482
 				spip_unlink($vignette);
1483 1483
 			}
@@ -1489,7 +1489,7 @@  discard block
 block discarded – undo
1489 1489
 		} else {
1490 1490
 			if ($format == 'gif') {
1491 1491
 				$giftopnm_command = str_replace('pnmscale', 'giftopnm', _PNMSCALE_COMMAND);
1492
-				exec("$giftopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1492
+				exec("$giftopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1493 1493
 				if (!($s = @filesize($vignette))) {
1494 1494
 					spip_unlink($vignette);
1495 1495
 				}
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
 			} else {
1502 1502
 				if ($format == 'png') {
1503 1503
 					$pngtopnm_command = str_replace('pnmscale', 'pngtopnm', _PNMSCALE_COMMAND);
1504
-					exec("$pngtopnm_command $image | " . _PNMSCALE_COMMAND . " -width $destWidth | $pnmtojpeg_command > $vignette");
1504
+					exec("$pngtopnm_command $image | "._PNMSCALE_COMMAND." -width $destWidth | $pnmtojpeg_command > $vignette");
1505 1505
 					if (!($s = @filesize($vignette))) {
1506 1506
 						spip_unlink($vignette);
1507 1507
 					}
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
 			return;
1524 1524
 		}
1525 1525
 		if (_IMG_GD_MAX_PIXELS && $srcWidth * $srcHeight > _IMG_GD_MAX_PIXELS) {
1526
-			spip_log('vignette gd1/gd2 impossible : ' . $srcWidth * $srcHeight . 'pixels');
1526
+			spip_log('vignette gd1/gd2 impossible : '.$srcWidth * $srcHeight.'pixels');
1527 1527
 
1528 1528
 			return;
1529 1529
 		}
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
 		// de l'image, de facon a tromper le cache du navigateur
1834 1834
 		// quand on fait supprimer/reuploader un logo
1835 1835
 		// (pas de filemtime si SAFE MODE)
1836
-		$date = test_espace_prive() ? ('?' . $date) : '';
1836
+		$date = test_espace_prive() ? ('?'.$date) : '';
1837 1837
 
1838 1838
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1839 1839
 	}
@@ -1879,7 +1879,7 @@  discard block
 block discarded – undo
1879 1879
 	public static function LittleEndian2String($number, $minbytes = 1) {
1880 1880
 		$intstring = '';
1881 1881
 		while ($number > 0) {
1882
-			$intstring = $intstring . chr($number & 255);
1882
+			$intstring = $intstring.chr($number & 255);
1883 1883
 			$number >>= 8;
1884 1884
 		}
1885 1885
 
@@ -1911,9 +1911,9 @@  discard block
 block discarded – undo
1911 1911
 					$b = $argb['blue'];
1912 1912
 
1913 1913
 					if ($bpp[$key] == 32) {
1914
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r) . chr($a);
1914
+						$icXOR[$key] .= chr($b).chr($g).chr($r).chr($a);
1915 1915
 					} elseif ($bpp[$key] == 24) {
1916
-						$icXOR[$key] .= chr($b) . chr($g) . chr($r);
1916
+						$icXOR[$key] .= chr($b).chr($g).chr($r);
1917 1917
 					}
1918 1918
 
1919 1919
 					if ($a < 128) {
@@ -1940,48 +1940,48 @@  discard block
 block discarded – undo
1940 1940
 
1941 1941
 			// BITMAPINFOHEADER - 40 bytes
1942 1942
 			$BitmapInfoHeader[$key] = '';
1943
-			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00";                // DWORD  biSize;
1944
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4);    // LONG   biWidth;
1943
+			$BitmapInfoHeader[$key] .= "\x28\x00\x00\x00"; // DWORD  biSize;
1944
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageWidths[$key], 4); // LONG   biWidth;
1945 1945
 			// The biHeight member specifies the combined
1946 1946
 			// height of the XOR and AND masks.
1947 1947
 			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($ImageHeights[$key] * 2, 4); // LONG   biHeight;
1948
-			$BitmapInfoHeader[$key] .= "\x01\x00";                    // WORD   biPlanes;
1949
-			$BitmapInfoHeader[$key] .= chr($bpp[$key]) . "\x00";              // wBitCount;
1950
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biCompression;
1951
-			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4);      // DWORD  biSizeImage;
1952
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biXPelsPerMeter;
1953
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // LONG   biYPelsPerMeter;
1954
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrUsed;
1955
-			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00";                // DWORD  biClrImportant;
1948
+			$BitmapInfoHeader[$key] .= "\x01\x00"; // WORD   biPlanes;
1949
+			$BitmapInfoHeader[$key] .= chr($bpp[$key])."\x00"; // wBitCount;
1950
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biCompression;
1951
+			$BitmapInfoHeader[$key] .= phpthumb_functions::LittleEndian2String($biSizeImage, 4); // DWORD  biSizeImage;
1952
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biXPelsPerMeter;
1953
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // LONG   biYPelsPerMeter;
1954
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrUsed;
1955
+			$BitmapInfoHeader[$key] .= "\x00\x00\x00\x00"; // DWORD  biClrImportant;
1956 1956
 		}
1957 1957
 
1958 1958
 
1959
-		$icondata = "\x00\x00";                    // idReserved;   // Reserved (must be 0)
1960
-		$icondata .= "\x01\x00";                    // idType;	   // Resource Type (1 for icons)
1961
-		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2);  // idCount;	  // How many images?
1959
+		$icondata = "\x00\x00"; // idReserved;   // Reserved (must be 0)
1960
+		$icondata .= "\x01\x00"; // idType;	   // Resource Type (1 for icons)
1961
+		$icondata .= phpthumb_functions::LittleEndian2String(count($gd_image_array), 2); // idCount;	  // How many images?
1962 1962
 
1963 1963
 		$dwImageOffset = 6 + (count($gd_image_array) * 16);
1964 1964
 		foreach ($gd_image_array as $key => $gd_image) {
1965 1965
 			// ICONDIRENTRY   idEntries[1]; // An entry for each image (idCount of 'em)
1966 1966
 
1967
-			$icondata .= chr($ImageWidths[$key]);           // bWidth;		  // Width, in pixels, of the image
1968
-			$icondata .= chr($ImageHeights[$key]);          // bHeight;		 // Height, in pixels, of the image
1969
-			$icondata .= chr($totalcolors[$key]);           // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1970
-			$icondata .= "\x00";                    // bReserved;	   // Reserved ( must be 0)
1967
+			$icondata .= chr($ImageWidths[$key]); // bWidth;		  // Width, in pixels, of the image
1968
+			$icondata .= chr($ImageHeights[$key]); // bHeight;		 // Height, in pixels, of the image
1969
+			$icondata .= chr($totalcolors[$key]); // bColorCount;	 // Number of colors in image (0 if >=8bpp)
1970
+			$icondata .= "\x00"; // bReserved;	   // Reserved ( must be 0)
1971 1971
 
1972
-			$icondata .= "\x01\x00";                  // wPlanes;		 // Color Planes
1973
-			$icondata .= chr($bpp[$key]) . "\x00";            // wBitCount;	   // Bits per pixel
1972
+			$icondata .= "\x01\x00"; // wPlanes;		 // Color Planes
1973
+			$icondata .= chr($bpp[$key])."\x00"; // wBitCount;	   // Bits per pixel
1974 1974
 
1975 1975
 			$dwBytesInRes = 40 + strlen($icXOR[$key]) + strlen($icAND[$key]);
1976 1976
 			$icondata .= phpthumb_functions::LittleEndian2String(
1977 1977
 				$dwBytesInRes,
1978 1978
 				4
1979
-			);     // dwBytesInRes;	// How many bytes in this resource?
1979
+			); // dwBytesInRes;	// How many bytes in this resource?
1980 1980
 
1981 1981
 			$icondata .= phpthumb_functions::LittleEndian2String(
1982 1982
 				$dwImageOffset,
1983 1983
 				4
1984
-			);    // dwImageOffset;   // Where in the file is this image?
1984
+			); // dwImageOffset;   // Where in the file is this image?
1985 1985
 			$dwImageOffset += strlen($BitmapInfoHeader[$key]);
1986 1986
 			$dwImageOffset += strlen($icXOR[$key]);
1987 1987
 			$dwImageOffset += strlen($icAND[$key]);
Please login to merge, or discard this patch.