diff --git a/src/utils/image.js b/src/utils/image.js index 33bdf11d8..73114b13b 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -316,6 +316,11 @@ export class RawImage { resample = 2, } = {}) { + // Do nothing if the image already has the desired size + if (this.width === width && this.height === height) { + return this; + } + // Ensure resample method is a string let resampleMethod = RESAMPLING_MAPPING[resample] ?? resample; @@ -742,4 +747,4 @@ export class RawImage { } }); } -} \ No newline at end of file +}