Skip to content

Commit

Permalink
do not override explicit values
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrik committed Dec 20, 2012
1 parent 7173325 commit bce4dc6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions ngx_http_image_filter_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,17 +1279,22 @@ ngx_http_image_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
1 * 1024 * 1024);

ngx_conf_merge_uint_value(conf->crop_offset_x, prev->crop_offset_x,
NGX_HTTP_IMAGE_OFFSET_CENTER);
ngx_conf_merge_uint_value(conf->crop_offset_y, prev->crop_offset_y,
NGX_HTTP_IMAGE_OFFSET_CENTER);
if (conf->crop_offset_x == NGX_CONF_UNSET_UINT) {
ngx_conf_merge_uint_value(conf->crop_offset_x, prev->crop_offset_x,
NGX_HTTP_IMAGE_OFFSET_CENTER);

if (conf->oxcv == NULL) {
conf->oxcv = prev->oxcv;
if (conf->oxcv == NULL) {
conf->oxcv = prev->oxcv;
}
}

if (conf->oycv == NULL) {
conf->oycv = prev->oycv;
if (conf->crop_offset_y == NGX_CONF_UNSET_UINT) {
ngx_conf_merge_uint_value(conf->crop_offset_y, prev->crop_offset_y,
NGX_HTTP_IMAGE_OFFSET_CENTER);

if (conf->oycv == NULL) {
conf->oycv = prev->oycv;
}
}

return NGX_CONF_OK;
Expand Down

0 comments on commit bce4dc6

Please sign in to comment.