Skip to content

Commit 9b8d785

Browse files
committed
test test test
1 parent 2b2bccf commit 9b8d785

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ it does more or less work.
2424

2525
`vips.c` defines a simple but ugly route to call any libvips operation from PHP.
2626
It uses libvips' own introspection facilities and does not depend on anything
27-
else (so no gobject-introspection, for example). It's a fairly short 1,200
27+
else (so no gobject-introspection, for example). It's a fairly short 1,600
2828
lines of C.
2929

3030
`vips.php` is a PHP layer over the ugly `vips.c` API that tries to make a nice
@@ -125,18 +125,16 @@ See `examples/`.
125125

126126
### TODO
127127

128+
* `[]` for band extract should be easy
129+
130+
* can we overload `()` for `getpoint`? unclear
131+
128132
* add phpDoc comments
129133

130134
need comments for magic properties
131135

132136
extra phpDoc comments for all magic methods, use py to generate
133137

134-
* tests for at least some of the enum expansions
135-
136-
* `[]` for band extract should be easy
137-
138-
* can we overload `()` for `getpoint`? unclear
139-
140138
* exceptions? logging?
141139

142140
### links

tests/040.phpt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
VImage::bandand works
3+
--SKIPIF--
4+
<?php if (!extension_loaded("vips")) print "skip"; ?>
5+
--FILE--
6+
<?php
7+
include 'vips.php';
8+
9+
$filename = dirname(__FILE__) . "/images/img_0076.jpg";
10+
$image = VImage::new_from_file($filename);
11+
12+
$pass = TRUE;
13+
14+
/* The original value of pixel (0, 0).
15+
*/
16+
$pixel = [39.1, 39.5, 34.9];
17+
18+
$true = $pixel[0] & $pixel[1] & $pixel[2];
19+
if ($image->bandand()->getpoint(0, 0) != [$true]) {
20+
$pass = FALSE;
21+
}
22+
23+
if ($pass) {
24+
echo "pass";
25+
}
26+
?>
27+
--EXPECT--
28+
pass

0 commit comments

Comments
 (0)