json_object* metadataResp = NULL;
json_object* metadata = NULL;
json_object* mdata_value = NULL;
- int channels = 1;
+ h->current_metadata->channels = 1;
metadataResp = json_tokener_parse(resp->data);
metadata = json_object_object_get(metadataResp, "Metadata");
h->current_metadata->format = 0;
if (h->current_metadata->format == 1)
- channels = 3;
+ h->current_metadata->channels = 3;
if (pnm_image.size > 0) {
free(pnm_image.data);
debug_printf_int(DEBUG, "size of pnm image", pnm_image.size);
if (h->current_metadata->depth == 1)
- h->current_metadata->bytes_per_line = channels * floor((h->current_metadata->pixels_per_line + 7) / 8);
+ h->current_metadata->bytes_per_line = h->current_metadata->channels * floor((h->current_metadata->pixels_per_line + 7) / 8);
else
- h->current_metadata->bytes_per_line = channels * h->current_metadata->pixels_per_line * h->current_metadata->depth / 8;
+ h->current_metadata->bytes_per_line = h->current_metadata->channels * h->current_metadata->pixels_per_line * h->current_metadata->depth / 8;
h->current_metadata->valid = 1;
h->current_metadata->is_last = 0;
h->current_scan_status->downloaded_images = 0;
h->current_scan_status->complete_scanned = 0;
h->current_metadata->format = 1;
+ h->current_metadata->channels = 3;
h->current_metadata->is_last = 0;
h->current_metadata->size = 0;
h->current_metadata->bytes_per_line = 0;
if (_change_output_type_to_images())
*info = RELOAD_OPTIONS;
+ char* str_Value = (char*) value;
+ if (strcmp(str_Value, "Color") == 0) {
+ h->current_metadata->format = 1;
+ h->current_metadata->channels = 3;
+ } else {
+ h->current_metadata->format = 0;
+ h->current_metadata->channels = 1;
+ }
+
+ *info |= RELOAD_PARAMS;
+
break;
case 5:
value_object = json_object_object_get(config, "SkipBlankPages");
case 25:
int* int_value = (int*) value;
h->current_metadata->depth = *int_value;
- *info = RELOAD_OPTIONS;
+ *info = RELOAD_PARAMS;
break;
default:
break;