Skip to content

Commit 395b0f0

Browse files
committed
use vips_header_get
should be faster
1 parent 96cf86f commit 395b0f0

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- add ^G to group selected rows
1010
- add "Group selected" to column menu
1111
- toolkitgroupview is more compact
12+
- add vips_header_get builtin
1213

1314
## 9.0.11 2025/07/21
1415

share/nip4/start/_predicate.def

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -490,26 +490,11 @@ is_hist x
490490

491491
get_header field x
492492
= oo_unary_function get_header_op x, is_class x
493-
= get_header_image x, is_image x
493+
= vips_header_get field x, is_image x
494494
= error (_ "bad arguments to " ++ "get_header")
495495
{
496496
get_header_op = Operator "get_header" (get_header field)
497497
Operator_type.COMPOUND false;
498-
get_header_image im
499-
= im_header_int field im, type == itype
500-
= im_header_double field im, type == dtype
501-
= im_header_string field im, type == stype1 || type == stype2
502-
= error (_ "image has no field " ++ field), type == 0
503-
= error (_ "unknown type for field " ++ field ++ " " ++ print
504-
type)
505-
{
506-
type = im_header_get_typeof field im;
507-
508-
itype = name2gtype "gint";
509-
dtype = name2gtype "gdouble";
510-
stype1 = name2gtype "VipsRefString";
511-
stype2 = name2gtype "gchararray";
512-
}
513498
}
514499

515500
get_header_type field x

0 commit comments

Comments
 (0)