Ciao a tutti ho un problema col ridimensionare immagini png con le gdi..
ho questo messaggio di errore:
Warning: imagepng() [function.imagepng]: gd-png error: compression level must be 0 through 9 in...
vi posto il codice:
Codice PHP:
private function resizePng($dim)
{
if($dim=='normal')
{
$this->width_resize=200;
$this->height_resize=200;
$path=$this->path.$this->image['name'];
}
else
{
$path=$this->path."thumb/".$this->image['name'];
}
// Ottengo le informazioni sull'immagine originale
list($width, $height, $type, $attr) = getimagesize($this->path.$this->image['name']);
$thumb = imagecreatetruecolor($this->width_resize,$this->height_resize);
$source = imagecreatefrompng($this->path.$this->image['name']);
imagecopyresized($thumb, $source, 0, 0, 0, 0,$this->width_resize,$this->height_resize,$width, $height);
// Salvo l'immagine ridimensionata
if(!is_dir($this->path."thumb/"))
{
mkdir($this->path."thumb/");
}
if(imagepng($thumb,$path, 75))
{
return true;
}
}
come posso risolvere?
grazie!