Sites Web : [12640] New filter image_format - SPIP commits - by tech-nova

Publié le lundi 21 avril 2008

⇒ http://my.opera.com/tech-nova/blog/

Un site qui recense les astuces et évolutions des possibilités de SPIP.

[12640] New filter image_format

Septembre 2008, Par tech-nova
« New » filter |image_format :
it saves the image in the chosen format, and keeps its transparency ; in fact it’s a shortcut for the « transparency » option that has just added ARNO* ([12638]) to the filter |image_aplatir

Example :
in inc-head.html, |image_formatico for the favicon

Note : image_aplatir corresponds to the following definition :

function image_aplatir($im, $format='jpg', $color='000000', $quality=NULL, $transparency=false) 


$im : the image itself
$format : the format to generate
$color : the background color that normaly replaces the alpha layout
$quality : see below
$transparency : Should the result image keep the transparency of the orginal, when possible (gif, png, ico)

image_aplatir normaly replaces the alpha layout by a specified color ($color). It can be used to change the format or the compression of an image. For such usage, it’s also possible to maintain the transparency with the last parameter.

$quality is used like this :
- For the jpg format, it correspond to the compression level (85 by default)
- for the gif format, it correspond to the number of colors of the palette (128 by default)
- for png pictures, $quality corresponds to the number of colors of the palette or, if equal to 0, to a truecolor image(default value)


→ Lire la suite sur le site d’origine…


Revenir en haut