Skip to content
Extraits de code Groupes Projets
Valider bd356b02 rédigé par ARNO*'s avatar ARNO*
Parcourir les fichiers

Bug arrondi image_sepia

parent 2697025a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -1202,6 +1202,9 @@ function decal_couleur_122 ($coul, $val) { ...@@ -1202,6 +1202,9 @@ function decal_couleur_122 ($coul, $val) {
if ($coul < 122) $y = round((($coul - 122) / 122) * $val) + $val; if ($coul < 122) $y = round((($coul - 122) / 122) * $val) + $val;
else if ($coul >= 122) $y = round((($coul - 122) / 123) * (255-$val)) + $val; else if ($coul >= 122) $y = round((($coul - 122) / 123) * (255-$val)) + $val;
else $y= $coul; else $y= $coul;
if ($y < 0) $y = 0;
if ($y > 255) $y = 255;
return $y; return $y;
} }
//function image_sepia($im, $dr = 137, $dv = 111, $db = 94) //function image_sepia($im, $dr = 137, $dv = 111, $db = 94)
...@@ -1225,7 +1228,7 @@ function image_sepia($im, $rgb = "896f5e") ...@@ -1225,7 +1228,7 @@ function image_sepia($im, $rgb = "896f5e")
$creer = $image["creer"]; $creer = $image["creer"];
if ($creer) { if ($creer OR 1==1) {
$im_ = $image["fonction_imagecreatefrom"]($im); $im_ = $image["fonction_imagecreatefrom"]($im);
imagetruecolortopalette($im_, true, 256); imagetruecolortopalette($im_, true, 256);
...@@ -1233,7 +1236,7 @@ function image_sepia($im, $rgb = "896f5e") ...@@ -1233,7 +1236,7 @@ function image_sepia($im, $rgb = "896f5e")
{ {
$color = ImageColorsForIndex($im_,$a); $color = ImageColorsForIndex($im_,$a);
$R=.299 * ($color['red'])+ .587 * ($color['green'])+ .114 * ($color['blue']); $R= round(.299 * ($color['red'])+ .587 * ($color['green'])+ .114 * ($color['blue']));
$G = $R; $G = $R;
$B = $R; $B = $R;
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter