Skip to content

Commit

Permalink
Add stub for GifQuantizeBuffer() which was removed in giflib 5.1.9
Browse files Browse the repository at this point in the history
This is similar to mono#37 except this time they removed the function completely.
Adding a stub which just ignores quantization until we have a use case that would require bringing back the functionality.

Fixes mono#546
  • Loading branch information
akoeplinger committed Jul 31, 2019
1 parent 8f9963e commit 4ca08d8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/gifcodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ GUID gdip_gif_image_format_guid = {0xb96b3cb0U, 0x0728U, 0x11d3U, {0x9d, 0x7b, 0

#include "gifcodec.h"

#if (GIFLIB_MAJOR >= 5) && ( ( (GIFLIB_MINOR == 1) && (GIFLIB_RELEASE >= 9) ) || (GIFLIB_MINOR >= 2) ) && !defined (GifQuantizeBuffer)
int GifQuantizeBuffer (unsigned int Width, unsigned int Height, int *ColorMapSize,
GifByteType *RedInput, GifByteType *GreenInput, GifByteType *BlueInput,
GifByteType *OutputBuffer, GifColorType *OutputColorMap) {
g_warning ("Using giflib version without GifQuantizeBuffer() API, skipping quantization. Resulting image may be unexpected.");
return GIF_OK;
}
#endif

#if (GIFLIB_MAJOR == 4) && (GIFLIB_MINOR >= 2) && !defined (QuantizeBuffer)
int QuantizeBuffer (unsigned int Width, unsigned int Height, int *ColorMapSize,
GifByteType *RedInput, GifByteType *GreenInput, GifByteType *BlueInput,
Expand Down

0 comments on commit 4ca08d8

Please sign in to comment.