File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 9
9
$ image = Vips \Image::black (1 , 1000000 );
10
10
$ image ->setProgress (true );
11
11
12
- $ image ->signalConnect ("preeval " , function ($ image , $ progress ) {
12
+ $ image ->signalConnect ("preeval " , function ($ image , $ progress ) {
13
13
echo "preeval: \n" ;
14
14
});
15
- $ image ->signalConnect ("eval " , function ($ image , $ progress ) {
15
+ $ image ->signalConnect ("eval " , function ($ image , $ progress ) {
16
16
echo "eval: $ progress ->percent % complete \r" ;
17
- });
17
+ });
18
18
19
- $ image ->signalConnect ("posteval " , function ($ image , $ progress ) {
19
+ $ image ->signalConnect ("posteval " , function ($ image , $ progress ) {
20
20
echo "\nposteval: \n" ;
21
21
});
22
22
Original file line number Diff line number Diff line change 27
27
});
28
28
29
29
// open for write and read ... formats like tiff need to be able to seek back
30
- // in the output and update bytes later
30
+ // in the output and update bytes later
31
31
$ out_file = fopen ($ argv [2 ], 'w+ ' );
32
32
$ target = new Vips \TargetCustom ();
33
33
$ target ->onWrite (function ($ buffer ) use (&$ out_file ) {
34
34
$ result = fwrite ($ out_file , $ buffer );
35
35
if ($ result === false ) {
36
36
// IO error
37
37
return -1 ;
38
- }
39
- else
38
+ } else {
40
39
return $ result ;
40
+ }
41
41
});
42
42
// read and seek are optional
43
43
$ target ->onSeek (function ($ offset , $ whence ) use (&$ out_file ) {
53
53
54
54
$ image = Vips \Image::newFromSource ($ source );
55
55
$ image ->writeToTarget ($ target , $ argv [3 ]);
56
-
Original file line number Diff line number Diff line change @@ -1299,7 +1299,7 @@ public function remove(string $name): void
1299
1299
/**
1300
1300
* Enable progress reporting on an image.
1301
1301
*
1302
- * The preeval, eval and posteval signals will be emitted on the
1302
+ * The preeval, eval and posteval signals will be emitted on the
1303
1303
* most-downstream image for which setProgress() was enabled. @see
1304
1304
* GObject::signalConnect().
1305
1305
*
@@ -1310,7 +1310,6 @@ public function remove(string $name): void
1310
1310
public function setProgress (bool $ progress ): void
1311
1311
{
1312
1312
FFI ::vips ()->vips_image_set_progress ($ this ->pointer , $ progress );
1313
-
1314
1313
}
1315
1314
1316
1315
/**
You can’t perform that action at this time.
0 commit comments