Ensure trim op supports image-in-alpha #1597

This commit is contained in:
Lovell Fuller
2019-11-14 11:29:45 +00:00
parent 833aaead56
commit c41b87303d
7 changed files with 37 additions and 3 deletions

View File

@@ -367,7 +367,10 @@ function extract (options) {
/**
* Trim "boring" pixels from all edges that contain values similar to the top-left pixel.
* Images consisting entirely of a single colour will calculate "boring" using the alpha channel, if any.
*
* The `info` response Object will contain `trimOffsetLeft` and `trimOffsetTop` properties.
*
* @param {Number} [threshold=10] the allowed difference from the top-left pixel, a number greater than zero.
* @returns {Sharp}
* @throws {Error} Invalid parameters