[mapserver-dev] msSaveImageBufferGD / msSaveImageGD implementation differences

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Mon Jan 4 12:01:15 EST 2010


+1, I have no objection...  -Steve

From: mapserver-dev-bounces at lists.osgeo.org [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Tamas Szekeres
Sent: Monday, January 04, 2010 10:57 AM
To: mapserver-dev at lists.osgeo.org
Subject: [mapserver-dev] msSaveImageBufferGD / msSaveImageGD implementation differences

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/e3693a6e/attachment.html


More information about the mapserver-dev mailing list