Skip to content

Commit

Permalink
Fix vips_isprefix() argument order
Browse files Browse the repository at this point in the history
The arguments were reversed, likely due to confusion with
`g_str_has_prefix()`. Ensures all metadata is removed when saving
with `keep=none`.

See: libvips#4224.
  • Loading branch information
kleisauke committed Oct 27, 2024
1 parent 6819735 commit fcdc00f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libvips/foreign/foreign.c
Original file line number Diff line number Diff line change
Expand Up @@ -1722,8 +1722,8 @@ vips_foreign_save_remove_metadata(VipsImage *image,
VipsForeignKeep keep = *((VipsForeignKeep *) user_data);

// we are only interested in metadata
if (!vips_isprefix(field, "png-comment-") &&
!vips_isprefix(field, "magickprofile-") &&
if (!vips_isprefix("png-comment-", field) &&
!vips_isprefix("magickprofile-", field) &&
strcmp(field, VIPS_META_IMAGEDESCRIPTION) != 0 &&
!g_str_has_suffix(field, "-data"))
return NULL;
Expand Down

0 comments on commit fcdc00f

Please sign in to comment.