Both items have type containing substring "image", but only the item with kind === "file" is valid for the method .getAsFile(), so an additional judgement items[i].kind === "file" will help exclude invalid items.
The issue seems related to the specific versions and settings of PowerPoint, as the issue exists with my PowerPoint (MS Office 2016, Windows 10) but not with some other versions (for example, MS Office 2019, Windows 10).
This could fix #301 .
I encountered the same problem as #301 that the page got stuck with "Processing...".
Through console debugging, I found that when copying/pasting a figure from PowerPoint, there may be two items in
ev.clipboardData.items
, namelyBoth items have
type
containing substring"image"
, but only the item withkind === "file"
is valid for the method.getAsFile()
, so an additional judgementitems[i].kind === "file"
will help exclude invalid items.The issue seems related to the specific versions and settings of PowerPoint, as the issue exists with my PowerPoint (MS Office 2016, Windows 10) but not with some other versions (for example, MS Office 2019, Windows 10).