mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
Fix variable get_img_width/height return value
Fix the functions to conform to the documentation: -1 means non-imaging device, 0 means variable. Internally, -1 is used to represent variable height (to be noticably different from the memset-imposed default of zero).
This commit is contained in:
@@ -68,6 +68,9 @@ int fpi_imgdev_get_img_width(struct fp_img_dev *imgdev)
|
||||
|
||||
if (width > 0 && imgdrv->enlarge_factor > 1)
|
||||
width *= imgdrv->enlarge_factor;
|
||||
else if (width == -1)
|
||||
width = 0;
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
@@ -77,8 +80,11 @@ int fpi_imgdev_get_img_height(struct fp_img_dev *imgdev)
|
||||
struct fp_img_driver *imgdrv = fpi_driver_to_img_driver(drv);
|
||||
int height = imgdrv->img_height;
|
||||
|
||||
if (height > 0 && imgdrv->enlarge_factor > 1)
|
||||
if (height > 0 && imgdrv->enlarge_factor > 1)
|
||||
height *= imgdrv->enlarge_factor;
|
||||
else if (height == -1)
|
||||
height = 0;
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user