Voting

: four minus two?
(Example: nine)

The Note You're Voting On

asgaroth dot belem at gmail dot com
15 years ago
About preserving the transparency when resizing PNGs this was the only thing that worked for me:

<?php imagealphablending($new_watermark, false);
$color = imagecolortransparent($new_watermark, imagecolorallocatealpha($new_watermark, 0, 0, 0, 127));
imagefill($new_watermark, 0, 0, $color);
imagesavealpha($new_watermark, true);
imagecopyresampled($new_watermark, $watermark, 0, 0, 0, 0, $new_watermark_width, $new_watermark_height, imagesx($watermark),imagesy($watermark));
?>

Tried without success:

<?php imagealphablending($new_watermark, false);
$color = imagecolortransparent($new_watermark, imagecolorallocate($new_watermark, 0, 0, 0));
imagefill($new_watermark, 0, 0, $color);
imagesavealpha($new_watermark, true);
imagecopyresampled($new_watermark, $watermark, 0, 0, 0, 0, $new_watermark_width, $new_watermark_height, imagesx($watermark),imagesy($watermark));
?>

hope it helps someone.

<< Back to user notes page

To Top