Skip to content

Commit adc8a4e

Browse files
committed
Merge branch 'master' of github.com:libvips/php-vips
2 parents fad7f0a + 2abe71c commit adc8a4e

File tree

5 files changed

+41
-22
lines changed

5 files changed

+41
-22
lines changed

Diff for: src/Config.php

+18-16
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,20 @@ private static function init(): void
346346
typedef int64_t gint64;
347347
348348
typedef $gtype GType;
349+
350+
typedef struct _GData GData;
351+
352+
typedef struct _GTypeClass GTypeClass;
353+
354+
typedef struct _GTypeInstance {
355+
GTypeClass *g_class;
356+
} GTypeInstance;
357+
358+
typedef struct _GObject {
359+
GTypeInstance g_type_instance;
360+
unsigned int ref_count;
361+
GData *qdata;
362+
} GObject;
349363
EOS;
350364

351365
// GLib declarations
@@ -361,14 +375,6 @@ private static function init(): void
361375
guint64 data[2];
362376
} GValue;
363377
364-
typedef struct _GData GData;
365-
366-
typedef struct _GTypeClass GTypeClass;
367-
368-
typedef struct _GTypeInstance {
369-
GTypeClass *g_class;
370-
} GTypeInstance;
371-
372378
typedef struct _GParamSpec {
373379
GTypeInstance g_type_instance;
374380
@@ -386,12 +392,6 @@ private static function init(): void
386392
unsigned int param_id;
387393
} GParamSpec;
388394
389-
typedef struct _GObject {
390-
GTypeInstance g_type_instance;
391-
unsigned int ref_count;
392-
GData *qdata;
393-
} GObject;
394-
395395
const char* g_type_name (GType gtype);
396396
GType g_type_from_name (const char* name);
397397
@@ -478,8 +478,7 @@ private static function init(): void
478478
typedef struct _VipsImage VipsImage;
479479
typedef struct _VipsProgress VipsProgress;
480480
481-
// Defined in GObject, just typedef to void*
482-
typedef void* GObject;
481+
// Defined in GObject, just typedef to void
483482
typedef void GParamSpec;
484483
typedef void GValue;
485484
@@ -781,6 +780,9 @@ private static function init(): void
781780
self::$gobject = \FFI::cdef($gobject_decls, $gobject_libname);
782781
self::$vips = \FFI::cdef($vips_decls, $vips_libname);
783782

783+
# Useful for debugging
784+
# self::$vips->vips_leak_set(1);
785+
784786
# force the creation of some types we need
785787
self::$vips->vips_blend_mode_get_type();
786788
self::$vips->vips_interpretation_get_type();

Diff for: tests/ConvenienceTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ protected function setUp(): void
2424
$this->pixel = $this->image->getpoint(0, 0);
2525
}
2626

27+
protected function tearDown(): void
28+
{
29+
unset($this->image);
30+
unset($this->pixel);
31+
}
32+
2733
public function testVipsBandjoin()
2834
{
2935
$image = Vips\Image::newFromArray([[1, 2, 3], [4, 5, 6]]);

Diff for: tests/ExceptionTest.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ class ExceptionTest extends TestCase
1212
*/
1313
private $image;
1414

15-
/**
16-
* The original value of pixel (0, 0).
17-
*/
18-
private $pixel;
19-
2015
protected function setUp(): void
2116
{
2217
$filename = __DIR__ . '/images/img_0076.jpg';
2318
$this->image = Vips\Image::newFromFile($filename);
24-
$this->pixel = $this->image->getpoint(0, 0);
19+
}
20+
21+
protected function tearDown(): void
22+
{
23+
unset($this->image);
2524
}
2625

2726
public function testVipsNewFromFileException()

Diff for: tests/MetaTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ protected function setUp(): void
2626
$this->png_image = Vips\Image::newFromFile($png_filename);
2727
}
2828

29+
protected function tearDown(): void
30+
{
31+
unset($this->image);
32+
unset($this->png_image);
33+
}
34+
2935
public function testVipsSetGet()
3036
{
3137
$this->image->poop = 'banana';

Diff for: tests/ShortcutTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ protected function setUp(): void
3737
$this->pixel = $this->image->getpoint(0, 0);
3838
}
3939

40+
protected function tearDown(): void
41+
{
42+
unset($this->image);
43+
unset($this->pixel);
44+
}
45+
4046
public function testVipsPow()
4147
{
4248
$real = self::mapNumeric($this->pixel, function ($value) {

0 commit comments

Comments
 (0)