From fc2505edaeb8d9f659f5f0d1bfb90d3337106dc3 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Thu, 22 Nov 2012 10:12:38 +0300 Subject: [PATCH 4/9] Split fpi_im_resize factor argument into width_factor and height_factor --- libfprint/drivers/aes4000.c | 2 +- libfprint/fp_internal.h | 2 +- libfprint/gdkpixbuf.c | 6 +++--- libfprint/imagemagick.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libfprint/drivers/aes4000.c b/libfprint/drivers/aes4000.c index 7fefde2..6ff32a2 100644 --- a/libfprint/drivers/aes4000.c +++ b/libfprint/drivers/aes4000.c @@ -155,7 +155,7 @@ static void img_cb(struct libusb_transfer *transfer) /* FIXME: this is an ugly hack to make the image big enough for NBIS * to process reliably */ - img = fpi_im_resize(tmp, ENLARGE_FACTOR); + img = fpi_im_resize(tmp, ENLARGE_FACTOR, ENLARGE_FACTOR); fp_img_free(tmp); fpi_imgdev_image_captured(dev, img); diff --git a/libfprint/fp_internal.h b/libfprint/fp_internal.h index 7d2cf89..eaa11d4 100644 --- a/libfprint/fp_internal.h +++ b/libfprint/fp_internal.h @@ -362,7 +362,7 @@ int fpi_img_compare_print_data(struct fp_print_data *enrolled_print, struct fp_print_data *new_print); int fpi_img_compare_print_data_to_gallery(struct fp_print_data *print, struct fp_print_data **gallery, int match_threshold, size_t *match_offset); -struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int factor); +struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor); /* polling and timeouts */ diff --git a/libfprint/gdkpixbuf.c b/libfprint/gdkpixbuf.c index ea2d5bc..4de6151 100644 --- a/libfprint/gdkpixbuf.c +++ b/libfprint/gdkpixbuf.c @@ -22,10 +22,10 @@ #include "fp_internal.h" -struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int factor) +struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor) { - int new_width = img->width * factor; - int new_height = img->height * factor; + int new_width = img->width * w_factor; + int new_height = img->height * h_factor; GdkPixbuf *orig, *resized; struct fp_img *newimg; guchar *pixels; diff --git a/libfprint/imagemagick.c b/libfprint/imagemagick.c index ed6a1ca..68e7146 100644 --- a/libfprint/imagemagick.c +++ b/libfprint/imagemagick.c @@ -22,14 +22,14 @@ #include "fp_internal.h" -struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int factor) +struct fp_img *fpi_im_resize(struct fp_img *img, unsigned int w_factor, unsigned int h_factor) { Image *mimg; Image *resized; ExceptionInfo exception; MagickBooleanType ret; - int new_width = img->width * factor; - int new_height = img->height * factor; + int new_width = img->width * w_factor; + int new_height = img->height * h_factor; struct fp_img *newimg; /* It is possible to implement resizing using a simple algorithm, however -- 1.8.0