Add timeout function to limit processing time

This commit is contained in:
Lovell Fuller
2021-09-22 10:33:46 +01:00
parent 197d4cf835
commit 1dd4be670d
10 changed files with 117 additions and 1 deletions

View File

@@ -542,6 +542,26 @@ sharp('input.tiff')
Returns **Sharp**
## timeout
Set a timeout for processing, in seconds.
Use a value of zero to continue processing indefinitely, the default behaviour.
The clock starts when libvips opens an input image for processing.
Time spent waiting for a libuv thread to become available is not included.
### Parameters
* `options` **[Object][6]**
* `options.seconds` **[number][9]** Number of seconds after which processing will be stopped
Returns **Sharp**
**Meta**
* **since**: 0.29.2
[1]: #withmetadata
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

View File

@@ -6,6 +6,8 @@ Requires libvips v8.11.3
### v0.29.2 - TBD
* Add `timeout` function to limit processing time.
* Ensure `sharp.versions` is populated from vendored libvips.
* Allow use of 'tif' to select TIFF output.

File diff suppressed because one or more lines are too long