Do not allow images sizes below 1 x 1 px

This commit is contained in:
javl
2026-08-15 09:53:16 +02:00
parent 1330a07d65
commit ab3d396d3f
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -68,8 +68,8 @@
<h2 class="sub-section-title">or paste byte array</h2> <h2 class="sub-section-title">or paste byte array</h2>
<textarea id="byte-input" class="byte-input"></textarea><br /> <textarea id="byte-input" class="byte-input"></textarea><br />
<div class="text-input-size"> <div class="text-input-size">
<input type="number" min="0" id="text-input-width" class="size-input" value="128" /> x <input type="number" min="1" id="text-input-width" class="size-input" value="128" /> x
<input type="number" min="0" id="text-input-height" class="size-input" value="64" /> px <input type="number" min="1" id="text-input-height" class="size-input" value="64" /> px
</div> </div>
<div class="note">Set this to the size of your image.<br>Common sizes: <a href="#" class="size-preset" onclick="setTextInputSize(16, 16); return false;"><code>16x16</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(32, 32); return false;"><code>32x32</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(64, 48); return false;"><code>64x48</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(128, 32); return false;"><code>128x32</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(128, 64); return false;"><code>128x64</code></a>.</div> <div class="note">Set this to the size of your image.<br>Common sizes: <a href="#" class="size-preset" onclick="setTextInputSize(16, 16); return false;"><code>16x16</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(32, 32); return false;"><code>32x32</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(64, 48); return false;"><code>64x48</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(128, 32); return false;"><code>128x32</code></a>, <a href="#" class="size-preset" onclick="setTextInputSize(128, 64); return false;"><code>128x64</code></a>.</div>
<div> <div>
+2 -2
View File
@@ -702,7 +702,7 @@ function handleImageSelection(evt) {
w.type = 'number'; w.type = 'number';
w.name = 'width'; w.name = 'width';
w.id = 'screenWidth'; w.id = 'screenWidth';
w.min = 0; w.min = 1;
w.className = 'size-input'; w.className = 'size-input';
w.value = img.width; w.value = img.width;
settings.screenWidth = img.width; settings.screenWidth = img.width;
@@ -716,7 +716,7 @@ function handleImageSelection(evt) {
h.type = 'number'; h.type = 'number';
h.name = 'height'; h.name = 'height';
h.id = 'screenHeight'; h.id = 'screenHeight';
h.min = 0; h.min = 1;
h.className = 'size-input'; h.className = 'size-input';
h.value = img.height; h.value = img.height;
settings.screenHeight = img.height; settings.screenHeight = img.height;