Commit da071ff8 authored by Daniel Drake's avatar Daniel Drake

Add API for freeing images

parent c2a83ec9
......@@ -94,6 +94,7 @@ int main(void)
fp_img_standardize(img);
r = fp_img_save_to_file(img, "finger_standardized.pgm");
fp_img_free(img);
if (r) {
fprintf(stderr, "standardized img save failed, code %d\n", r);
goto out_close;
......
......@@ -100,6 +100,7 @@ int fp_img_get_width(struct fp_img *img);
unsigned char *fp_img_get_data(struct fp_img *img);
int fp_img_save_to_file(struct fp_img *img, char *path);
void fp_img_standardize(struct fp_img *img);
void fp_img_free(struct fp_img *img);
/* Library */
int fp_init(void);
......
......@@ -61,6 +61,11 @@ struct fp_img *fpi_img_resize(struct fp_img *img, size_t newsize)
return g_realloc(img, sizeof(*img) + newsize);
}
API_EXPORTED void fp_img_free(struct fp_img *img)
{
g_free(img);
}
API_EXPORTED int fp_img_get_height(struct fp_img *img)
{
return img->height;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment