diff --git a/src/main/java/io/pyke/vitri/finorza/inference/util/Screenshot.java b/src/main/java/io/pyke/vitri/finorza/inference/util/Screenshot.java index 9bf729f..79f87b0 100644 --- a/src/main/java/io/pyke/vitri/finorza/inference/util/Screenshot.java +++ b/src/main/java/io/pyke/vitri/finorza/inference/util/Screenshot.java @@ -55,6 +55,14 @@ public Screenshot(int resizeWidth, int resizeHeight) { return this.resizeBuffer; // no data } + if (this.width == this.resizeWidth && this.height == this.resizeHeight) { + // Only do the Y flip + for (int y = 0; y < this.height - 1; y++) { + this.resizeBuffer.put((this.height - 1 - y) * this.width * 3, this.buffer, y * this.width * 3, this.width * 3); + } + return this.resizeBuffer; + } + final double wr = (double) this.width / this.resizeWidth; final double hr = (double) this.height / this.resizeHeight; for (int y = 0; y < this.resizeHeight; y++) {