debug_printf(ALL, "get_current_metadata");
json_object* metadata = NULL;
json_object* config = NULL;
- blobdata* jpg_image = NULL;
+ blobdata* scanner_image = NULL;
blobdata* pnm_image = NULL;
image_metadata* mdata = NULL;
if (h->current_metadata->format == 1)
h->current_metadata->channels = 3;
- jpg_image = (blobdata*) h->jpg_image;
+ scanner_image = (blobdata*) h->scanner_image;
pnm_image = (blobdata*) h->pnm_image;
- kds_s2000w_metadata_from_image(jpg_image, mdata);
+ kds_s2000w_metadata_from_image(scanner_image, mdata);
h->current_metadata->depth = mdata->depth;
h->current_metadata->pixels_per_line = mdata->width;
h->current_metadata->lines = mdata->height;
if (h->current_metadata->depth > 8) {
h->current_metadata->depth = 8;
- kds_s2000w_convert_jpg_to_pnm_with_depth(jpg_image, pnm_image, h->current_metadata->depth);
+ kds_s2000w_convert_jpg_to_pnm_with_depth(scanner_image, pnm_image, h->current_metadata->depth);
} else {
- kds_s2000w_convert_tiff_to_pnm(jpg_image, pnm_image);
+ kds_s2000w_convert_tiff_to_pnm(scanner_image, pnm_image);
}
debug_printf_int(DEBUG, "size of pnm image", h->pnm_image->size);
debug_printf(ALL, "download_current_image");
response* resp = NULL;
- if (h->jpg_image->size > 0) {
- free(h->jpg_image->data);
- h->jpg_image->data = NULL;
- h->jpg_image->size = 0;
+ if (h->scanner_image->size > 0) {
+ free(h->scanner_image->data);
+ h->scanner_image->data = NULL;
+ h->scanner_image->size = 0;
}
resp = kds_s2000w_client_response_init();
if (resp->error_size > 0)
fprintf(stderr, "%s\n", resp->error_status);
- h->jpg_image->size = resp->size;
- h->jpg_image->data = malloc(sizeof(char) * resp->size);
- memcpy(h->jpg_image->data, resp->data, resp->size);
+ h->scanner_image->size = resp->size;
+ h->scanner_image->data = malloc(sizeof(char) * resp->size);
+ memcpy(h->scanner_image->data, resp->data, resp->size);
kds_s2000w_client_response_free(resp);
resp = NULL;
h->current_scan_status->downloaded_images++;
h->current_scan_status = malloc(sizeof(scanstatus));
h->current_metadata = malloc(sizeof(metadata));
h->read_info = malloc(sizeof(readinfo));
- h->jpg_image = malloc(sizeof(imagedata));
+ h->scanner_image = malloc(sizeof(imagedata));
h->pnm_image = malloc(sizeof(imagedata));
h->sessionid = 0;
h->read_info->read_size = 0;
h->read_info->readed_bytes_per_line = 0;
h->read_info->readed_lines = 0;
- h->jpg_image->size = 0;
- h->jpg_image->data = NULL;
+ h->scanner_image->size = 0;
+ h->scanner_image->data = NULL;
h->pnm_image->size = 0;
h->pnm_image->data = NULL;
h->current_metadata = NULL;
free(h->read_info);
h->read_info = NULL;
- free(h->jpg_image->data);
- h->jpg_image->data = NULL;
- free(h->jpg_image);
- h->jpg_image = NULL;
+ free(h->scanner_image->data);
+ h->scanner_image->data = NULL;
+ free(h->scanner_image);
+ h->scanner_image = NULL;
free(h->pnm_image);
h->pnm_image = NULL;
free(h);
debug_printf(ALL, "reset handler");
free(h->pnm_image->data);
h->pnm_image->data = NULL;
- free(h->jpg_image->data);
- h->jpg_image->data = NULL;
+ free(h->scanner_image->data);
+ h->scanner_image->data = NULL;
h->state = NOTCONNECTED;
h->current_scan_status->load_options = 0;
h = init_handler();
*handle = h;
- h->jpg_image->size = 0;
- h->jpg_image->data = NULL;
+ h->scanner_image->size = 0;
+ h->scanner_image->data = NULL;
h->pnm_image->size = 0;
h->pnm_image->data = NULL;