Skip to content
Permalink
Browse files

Make sure a format is set for non-image (i.e. blob) tiles so a proper…

… mime-type can be set.
  • Loading branch information...
sdlime committed Apr 11, 2017
1 parent 23891f2 commit cfe4bcbf6b1e6b76727c342a6da770f44f48eb34
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/core.c
@@ -292,7 +292,7 @@ mapcache_http_response *mapcache_core_get_tile(mapcache_context *ctx, mapcache_r
}

if(!response->data) {
/* we need to encode the raw image data*/
/* we need to encode the raw image data */
if(base) {
if(req_tile->image_request.format) {
format = req_tile->image_request.format;
@@ -317,6 +317,16 @@ mapcache_http_response *mapcache_core_get_tile(mapcache_context *ctx, mapcache_r
response->data = mapcache_empty_png_decode(ctx,req_tile->tiles[0]->grid_link->grid->tile_sx, req_tile->tiles[0]->grid_link->grid->tile_sy, empty,&is_empty); /* is_empty is unchanged and left to 1 */
format = mapcache_configuration_get_image_format(ctx->config,"PNG8");
}
} else {
/* set format, not an image type (e.g. GC_BLOB) */
if(req_tile->image_request.format) {
format = req_tile->image_request.format;
} else {
format = req_tile->tiles[0]->tileset->format;
if(!format) {
format = ctx->config->default_image_format; /* this one is always defined */
}
}
}

/* compute the content-type */
@@ -502,6 +512,7 @@ mapcache_http_response *mapcache_core_get_map(mapcache_context *ctx, mapcache_re
}

/* compute the content-type */
ctx->log(ctx,MAPCACHE_DEBUG,"SDL: setting content type (2)");
if(format && format->mime_type) {
apr_table_set(response->headers,"Content-Type",format->mime_type);
} else {

0 comments on commit cfe4bcb

Please sign in to comment.
You can’t perform that action at this time.