We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0276e3a commit 4a202f5Copy full SHA for 4a202f5
src/handlers/opusMagnum.ts
@@ -722,6 +722,15 @@ export class opusMagnumITMHandler implements FormatHandler {
722
this.#canvas.width = Math.floor(image.width*(max_canvas/image.height));
723
this.#canvas.height = max_canvas;
724
}
725
+
726
+ // Safety for extreme proportions (t.w.s.s.)
727
+ if (this.#canvas.width < 1) {
728
+ this.#canvas.width = 1;
729
+ }
730
+ if (this.#canvas.height < 1) {
731
+ this.#canvas.height = 1;
732
733
734
console.log("Image resized to "+this.#canvas.width+" "+this.#canvas.height);
735
736
else {
0 commit comments