Update index.js
Browse files
index.js
CHANGED
@@ -344,7 +344,7 @@ export async function imageTextToText(
|
|
344 |
async function updatePreview(url) {
|
345 |
const image = await RawImage.fromURL(url);
|
346 |
const ar = image.width / image.height;
|
347 |
-
const [cw, ch] = (ar > 1) ? [
|
348 |
thumb.style.width = `${cw}px`;
|
349 |
thumb.style.height = `${ch}px`;
|
350 |
thumb.style.backgroundImage = `url(${url})`;
|
|
|
344 |
async function updatePreview(url) {
|
345 |
const image = await RawImage.fromURL(url);
|
346 |
const ar = image.width / image.height;
|
347 |
+
const [cw, ch] = (ar > 1) ? [320, 320 / ar] : [320 * ar, 320];
|
348 |
thumb.style.width = `${cw}px`;
|
349 |
thumb.style.height = `${ch}px`;
|
350 |
thumb.style.backgroundImage = `url(${url})`;
|