Hi!
I want to resize uploaded GIF images. Currently I do it like this:
<?php
// ...
$img = imagecreatefromgif($path);
$img_scaled = imagecreate($new_width, $new_height);
imagecopyresampled($img_scaled, $img, 0, 0, 0, 0, $new_width, $new_height,
$old_width, $old_height);
imagegif($img_scaled, $new_path);
// ...
?>
This works like expected except for transparency, which is gone after the
resizing. Furthermore the resulting smaller image doesnt appear to be
resampled nicely. For me its looking exactly like the result of
imagecopyresized(). I think this has something to do with the paletted
nature of GIFs but Im far from an expert in image manipulation. What I want
is a nice looking (i.e. resampled) downsized GIF with transparency if the
original image did have it. TIA for any help!
Regards
Matthias