MCPcopy Index your code
hub / github.com/MapServer/MapServer / msSaveRasterBufferToBuffer

Function msSaveRasterBufferToBuffer

mapimageio.c:931–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931int msSaveRasterBufferToBuffer(rasterBufferObj *data, bufferObj *buffer,
932 outputFormatObj *format) {
933 if(data->type == MS_BUFFER_GD) {
934 return saveGdImageBuffer(data->data.gd_img, buffer, format);
935 }
936 if(strcasestr(format->driver,"/png")) {
937 streamInfo info;
938 info.fp = NULL;
939 info.buffer = buffer;
940 return saveAsPNG(NULL, data,&info,format);
941 } else if(strcasestr(format->driver,"/jpeg")) {
942 streamInfo info;
943 info.fp = NULL;
944 info.buffer=buffer;
945 return saveAsJPEG(NULL, data,&info,format);
946 } else {
947 msSetError(MS_MISCERR,"unsupported image format\n", "msSaveRasterBuffer()");
948 return MS_FAILURE;
949 }
950}
951#ifdef USE_GIF
952static char const *gif_error_msg() {
953 static char msg[80];

Callers 1

msSaveImageBufferFunction · 0.85

Calls 5

saveGdImageBufferFunction · 0.85
strcasestrFunction · 0.85
saveAsPNGFunction · 0.85
saveAsJPEGFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected