When upgrading a DokuWiki wiki to 2009-02-14, I noticed that the quality of resized GIF images worsened dramatically. The resized GIF images have ugly, jagged edges. See the attached files for the difference between old and new version of the resized image.
Strangely, this problem does not exist for PNG images. With some experiments, I tracked this down to the use of imagecreate instead of imagecreatetruecolor for GIF images in function media_resize_imageGD in inc/media.php:
if(($conf['gdlib']>1) && function_exists("imagecreatetruecolor") && $ext != 'gif'){
$newimg = @imagecreatetruecolor ($to_w, $to_h);
}
if(!$newimg) $newimg = @imagecreate($to_w, $to_h);
If you disable the exception for gif files, the old behavior returns.
This code was previously in lib/exe/fetch.php. It appears the change was introduced to support transparent GIF images:
http://dev.splitbrain.org/darcsweb/darcsweb.cgi?r=dokuwiki;a=darcs_commitdiff;h=20071221181419-3d7ce-f05705a0357412a87e7984a041ac5812eea83048.gz;
Perhaps it is not possible to retain image transparancy with imagecreatetruecolor. In that case, I would like to be able to disable the support for resized transparent GIFs with a configuration option.