[mapserver-dev] msSaveImageBufferGD / msSaveImageGD implementation differences

Tamas Szekeres szekerest at gmail.com
Mon Jan 4 11:57:04 EST 2010


Hi Devs,

According to  http://trac.osgeo.org/mapserver/ticket/3201 it looks like the
implementations of msSaveImageBufferGD and msSaveImageGD are getting largely
out of sync.
In msSaveImageBufferGD the implementation of msSaveImageRGBAPalette and
msSaveImageRGBAQuantized is completely missing and this one doesn't support
the QUANTIZE_NEW option either.
I consider this as a critical issue for the mapscript users which should
also be fixed in the stable branch. I've prepared a new version of
msSaveImageBufferGD which would use the same internal method as what
msSaveImageGD is using when saving the image (msSaveImageGDCtx). See the
implementation below:

unsigned char *msSaveImageBufferGD(imageObj *img, int *size_ptr,
outputFormatObj *format)
{
  unsigned char *imgbytes;

  gdIOCtx *ctx = gdNewDynamicCtx (2048, NULL);
  if (msSaveImageGDCtx( img, ctx, format ) == MS_SUCCESS)
    imgbytes = gdDPExtractData (ctx, size_ptr);
  else
    imgbytes = NULL;

  ctx->gd_free(ctx);

  return imgbytes;
}


Any objection to apply this fix in both the trunk and the stable(5-6)
branch?

Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20100104/49327a0e/attachment.html


More information about the mapserver-dev mailing list