mam taki kod:
function createThumbnail($path, $imagename, $rozmiar) { /////// tworzymy miniaturkę $type = $wynik[1]; $site_max_thumbnails_size = $rozmiar; // max size if ($type== "jpg" || $type== "jpeg"){ $img = imagecreatefromjpeg( "{$path}{$imagename}" ); } if ($type== "png"){ $img = imagecreatefrompng( "{$path}{$imagename}" ); } if ($type== "gif"){ $img = imagecreatefromgif( "{$path}{$imagename}" ); } $width = imagesx( $img ); $height = imagesy( $img ); // calculate thumbnail size if ($height>=$width) { $smallerSize=$width; $croppingStartHeight=($height-$smallerSize)/2; $croppingStartWidth=0; } else { $smallerSize=$height; $croppingStartHeight=0; $croppingStartWidth=($width-$smallerSize)/2; } $croppedImage=imagecreatetruecolor($smallerSize, $smallerSize); // create square image $resizedImage=imagecreatetruecolor($site_max_thumbnails_size, $site_max_thumbnails_size); imagecopy($croppedImage, $img, 0, 0, $croppingStartWidth, $croppingStartHeight, $smallerSize, $smallerSize); // build cropped, square image imagecopyresampled ($resizedImage, $croppedImage, 0, 0, 0, 0, $site_max_thumbnails_size, $site_max_thumbnails_size, $smallerSize, $smallerSize); // copy and resize old image into new image $pathToThumbs=$path.""; if ($type== "jpg" || $type== "jpeg"){ if (!imagejpeg($resizedImage, "{$pathToThumbs}mini_{$imagename}" )) // save thumbnail into a file $result='Nie można zapisać miniaturki w folderze docelowym!'; ImageDestroy($croppedImage); ImageDestroy($resizedImage); return $result; } if ($type== "png"){ if (!imagepng($resizedImage, "{$pathToThumbs}mini_{$imagename}" )) // save thumbnail into a file $result='Nie można zapisać miniaturki w folderze docelowym!'; ImageDestroy($croppedImage); ImageDestroy($resizedImage); return $result; } if ($type== "gif"){ if (!imagegif($resizedImage, "{$pathToThumbs}mini_{$imagename}" )) // save thumbnail into a file $result='Nie można zapisać miniaturki w folderze docelowym!'; ImageDestroy($croppedImage); ImageDestroy($resizedImage); return $result; } }
przy wgrywaniu i obróbce przeźroczystych PNG mam czarne tło

Z góry dziękuje za pomoc,
Northwest