File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,12 @@ public function testPpmLoadBuffer()
43430 0 0
4444 " ;
4545
46- // the PPM loader is built in and should be available in most
47- // libvips binaries
48- $ image = Vips \Image::ppmload_buffer ($ ppm );
49- $ this ->assertTrue ($ image ->width == 1 );
46+ if (Vips \Utils::typeFromName ("VipsForeignLoadPpm " ) != 0 ) {
47+ // the PPM loader is built in and should be available in most
48+ // libvips binaries
49+ $ image = Vips \Image::ppmload_buffer ($ ppm );
50+ $ this ->assertTrue ($ image ->width == 1 );
51+ }
5052 }
5153
5254 public function testBlockUntrusted ()
@@ -57,7 +59,8 @@ public function testBlockUntrusted()
57590 0 0
5860 " ;
5961
60- if (Vips \FFI ::atLeast (8 , 13 )) {
62+ if (Vips \FFI ::atLeast (8 , 13 ) &&
63+ Vips \Utils::typeFromName ("VipsForeignLoadPpm " ) != 0 ) {
6164 Vips \Config::setBlockUntrusted (true );
6265
6366 // should fail
@@ -75,7 +78,8 @@ public function testBlock()
75780 0 0
7679 " ;
7780
78- if (Vips \FFI ::atLeast (8 , 13 )) {
81+ if (Vips \FFI ::atLeast (8 , 13 ) &&
82+ Vips \Utils::typeFromName ("VipsForeignLoadPpm " ) != 0 ) {
7983 Vips \Config::setBlockUntrusted (true );
8084 Vips \Config::setBlock ("VipsForeignLoadPpm " , false );
8185
You can’t perform that action at this time.
0 commit comments