Skip to content

Commit

Permalink
Merge branch '8.16' into 8.16-tiffsave-honor-disc-threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
jcupitt authored Jan 23, 2025
2 parents 1b49f67 + f24c62e commit a218d9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- exif: ensure enumerated entries can to converted to string values [lovell]
- gifsave: add support for eval callback, ensure correct return code [lovell]
- tiffsave: honor disc threshold during pyramid save [kleisauke]
- fill_nearest: fix a leak

10/10/24 8.16.0

Expand Down
15 changes: 4 additions & 11 deletions libvips/morphology/nearest.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ vips_fill_nearest_finalize(GObject *gobject)
{
VipsFillNearest *nearest = (VipsFillNearest *) gobject;

#ifdef DEBUG
printf("vips_fill_nearest_finalize: ");
vips_object_print_name(VIPS_OBJECT(gobject));
printf("\n");
#endif /*DEBUG*/

VIPS_FREEF(g_array_unref, nearest->seeds);

G_OBJECT_CLASS(vips_fill_nearest_parent_class)->finalize(gobject);
Expand Down Expand Up @@ -244,8 +238,7 @@ vips_fill_nearest_build(VipsObject *object)
if (i != ps) {
Seed *seed;

g_array_set_size(nearest->seeds,
nearest->seeds->len + 1);
g_array_set_size(nearest->seeds, nearest->seeds->len + 1);
seed = &g_array_index(nearest->seeds,
Seed, nearest->seeds->len - 1);
seed->x = x;
Expand All @@ -261,9 +254,9 @@ vips_fill_nearest_build(VipsObject *object)
/* Create the output and distance images in memory.
*/
g_object_set(object, "distance", vips_image_new_memory(), NULL);
if (vips_black(&t[1], nearest->width, nearest->height, NULL) ||
vips_cast(t[1], &t[2], VIPS_FORMAT_FLOAT, NULL) ||
vips_image_write(t[2], nearest->distance))
if (vips_black(&t[0], nearest->width, nearest->height, NULL) ||
vips_cast(t[0], &t[1], VIPS_FORMAT_FLOAT, NULL) ||
vips_image_write(t[1], nearest->distance))
return -1;

g_object_set(object, "out", vips_image_new_memory(), NULL);
Expand Down

0 comments on commit a218d9d

Please sign in to comment.