Skip to content

Commit 14794bc

Browse files
committed
fix counts on input vips8 image arrays
oops, was not reffing images
1 parent f4e6d0a commit 14794bc

File tree

2 files changed

+7
-58
lines changed

2 files changed

+7
-58
lines changed

TODO

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,12 @@
1-
- fix up autotrace
2-
3-
falsecolour output, drag sliders, occasional segv ... unreffing a region in
4-
maplut_stop on an image that's already been freed? ouch
5-
6-
try:
7-
8-
- load image
9-
- extract green
10-
- size down to 128x128
11-
- save as x.v
12-
- restart nip2
13-
- load x.v
14-
- click trace
15-
- ^Q
16-
17-
see:
18-
19-
(nip2:29365): GLib-GObject-WARNING **: instance of invalid non-instantiatable type '(null)'
20-
(nip2:29365): GLib-GObject-CRITICAL **: g_signal_handler_is_connected: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
21-
(nip2:29365): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
22-
(nip2:29365): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
23-
(nip2:29365): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
24-
25-
try:
26-
27-
$ valgrind vips system "autotrace %s -output-format svg -output-file %s
28-
-despeckle-level 9 -line-threshold 1" --in x.v --out x2.v --in-format %s.ppm
29-
--out-format %s.svg[scale=2]
30-
31-
runs cleanly, so the error is probably in vips_call
32-
33-
try:
34-
35-
- load x.v
36-
- vips_call "system" ["autotrace %s -output-format svg -output-file %s"] [$in => [A1.value], $in_format => "%s.ppm", $out => true, $out_format => "%s.svg"]
37-
38-
see:
39-
40-
(nip2:30392): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT
41-
(object)' failed
42-
431
- expose kernel option in vips_resize(), then use that in nip2 resize ... will
442
need to be 8.4
453

464
need to be able to set enums to vips8 calls, maybe set as strings?
475

486
- sharpen should use new interface?
497

50-
- redo scale along the new vipsthumbnail lines
51-
52-
need to be able to get window_size from an interp
53-
54-
just call vips_resize()?
55-
568
- can we call affine from nip2 vips_call? do we need a double array?
579

58-
- fix up menu tear-off, again
59-
60-
bug in gtk and won't be fixed, tear-off menus are deprecated
61-
62-
https://bugzilla.gnome.org/show_bug.cgi?id=627511
63-
64-
oh argh, might as well remove all tear-off code and direct people to the tk
65-
browser instead
66-
6710
- hough_circle etc. don't get cached ... they use the vips8 API and the vips
6811
cache only works for vips8
6912

src/heap.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,8 +1903,14 @@ heap_ip_to_gvalue( PElement *in, GValue *out )
19031903
g_value_init( out, VIPS_TYPE_ARRAY_IMAGE );
19041904
vips_value_set_array_image( out, n );
19051905
ivec = vips_value_get_array_image( out, NULL );
1906-
for( i = 0; i < n; i++ )
1906+
for( i = 0; i < n; i++ ) {
19071907
ivec[i] = imageinfo_get( FALSE, iivec[i] );
1908+
1909+
/* g_value_unset() on out will unref every
1910+
* array element, so we need to ref.
1911+
*/
1912+
g_object_ref( ivec[i] );
1913+
}
19081914
}
19091915
#endif
19101916
else {

0 commit comments

Comments
 (0)