Skip to content

Commit

Permalink
Rename variable; fall back to JPEG if there's no PNG (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
justvanrossum committed Nov 16, 2024
1 parent e37669a commit ee8d467
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fontra/views/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2188,8 +2188,11 @@ export class EditorController {
}

async _pasteClipboardImage() {
const pngBlob = await readFromClipboard("image/png", false);
if (!pngBlob) {
const imageBlob =
(await readFromClipboard("image/png", false)) ||
(await readFromClipboard("image/jpeg", false));

if (!imageBlob) {
return;
}

Expand All @@ -2199,7 +2202,7 @@ export class EditorController {
reader.onerror = reject;
});

reader.readAsDataURL(pngBlob);
reader.readAsDataURL(imageBlob);

const dataURL = await resultPromise;
if (!dataURL) {
Expand Down

0 comments on commit ee8d467

Please sign in to comment.