From 67f1f5f108ae18490d59f512975b5d222e1c1a10 Mon Sep 17 00:00:00 2001 From: phellmayr1 Date: Thu, 7 Jul 2022 08:35:22 +0200 Subject: [PATCH] Add new callback when Tile was resized --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 48b1411..0f10e4b 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,10 @@ const DEFAULT_RESIZE_OPTS = { filter: 'mks2013', unsharpAmount: 0, unsharpRadius: 0.0, - unsharpThreshold: 0 + unsharpThreshold: 0, + onTileResized: function () { + this.debug('tile was resized'); + } }; let CAN_NEW_IMAGE_DATA = false; @@ -401,6 +404,7 @@ Pica.prototype.__tileAndResize = function (from, to, opts) { return this.__invokeResize(tileOpts, opts); }) .then(result => { + opts.onTileResized(result); if (opts.canceled) return opts.cancelToken; stageEnv.srcImageData = null; return this.__landTileData(tile, result, stageEnv);