Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c924df0

Browse files
committed
add Trim menu item
1 parent eb5b94e commit c924df0

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

ChangeLog

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
started 8.9.0 10/4/20
2+
- add find_trim
3+
14
started 8.7.1 13/11/18
25
- fix uint status bar pixels >2**31 [Rob Erdmann]
36
- fix crash on redhat [bgilbert]

configure.ac

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Process this file with autoconf to produce a configure script.
22

3-
AC_INIT([nip2], [8.7.1], [[email protected]])
3+
AC_INIT([nip2], [8.9.0], [[email protected]])
44

55
# foreign stops complaints about a missing README (we use README.md instead)
66
# and missing INSTALL (the standard Gnu INSTALL is not very useful)
@@ -16,8 +16,8 @@ dnl of them.
1616
dnl
1717

1818
m4_define([nip_major_version], [8])
19-
m4_define([nip_minor_version], [7])
20-
m4_define([nip_micro_version], [1])
19+
m4_define([nip_minor_version], [9])
20+
m4_define([nip_micro_version], [0])
2121
m4_define([nip_version],
2222
[nip_major_version.nip_minor_version.nip_micro_version])
2323

share/nip2/start/Image.def

+23
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,29 @@ Image_crop_item = class
12861286
}
12871287
}
12881288

1289+
Trim_item = class Menuaction "_Trim" "crop away edges" {
1290+
action x = class
1291+
_result {
1292+
_vislevel = 3;
1293+
1294+
thresh = Scale "threshold" 0 100 10;
1295+
background = Expression "Background" default_background
1296+
{
1297+
default_background
1298+
= map mean (bandsplit (extract_area 0 0 1 1 x));
1299+
}
1300+
1301+
_result
1302+
= Region x l t w h
1303+
{
1304+
[l, t, w, h] = vips_call "find_trim" [x.value] [
1305+
$threshold => thresh.value,
1306+
$background => background.expr
1307+
];
1308+
}
1309+
}
1310+
}
1311+
12891312
Image_insert_item = class
12901313
Menuaction "_Insert" "insert a small image into a large image" {
12911314
action a b

0 commit comments

Comments
 (0)