Add coords to output when using attention based crop (#3470)

This commit is contained in:
Emanuel Jöbstl
2023-01-16 10:20:42 +01:00
committed by GitHub
parent bdc50e1d6e
commit 6d404f4d2c
5 changed files with 46 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ const bitdepthFromColourCount = (colours) => 1 << 31 - Math.clz32(Math.ceil(Math
* `info` contains the output image `format`, `size` (bytes), `width`, `height`,
* `channels` and `premultiplied` (indicating if premultiplication was used).
* When using a crop strategy also contains `cropOffsetLeft` and `cropOffsetTop`.
* When using attention as crop strategy also contains the center of the cropped region in the fields `attentionX` and `attentionY`.
* May also contain `textAutofitDpi` (dpi the font was rendered at) if image was created from text.
* @returns {Promise<Object>} - when no callback is provided
* @throws {Error} Invalid parameters