pasteimages icon indicating copy to clipboard operation
pasteimages copied to clipboard

Failed to get data from the clipboard. Data is no longer available. Aborting operation.

Open brothertao opened this issue 3 years ago • 3 comments

Failed to get data from the clipboard. Data is no longer available. Aborting operation.

java.io.IOException: Exception fetching data: 
	at java.desktop/sun.awt.datatransfer.ClipboardTransferable.getTransferData(ClipboardTransferable.java:156)
	at org.intellij.images.ide.ImagePasteProvider.performPaste(ImagePasteProvider.kt:54)
	at com.intellij.codeInsight.editorActions.PasteHandler.lambda$execute$2(PasteHandler.java:108)
	at com.intellij.openapi.project.DumbService.runWithAlternativeResolveEnabled(DumbService.java:369)
	at com.intellij.codeInsight.editorActions.PasteHandler.execute(PasteHandler.java:103)
	at com.intellij.codeInsight.editorActions.PasteHandler.doExecute(PasteHandler.java:59)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:199)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:89)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:198)
	at img2md.PasteImageHandler.doExecute(PasteImageHandler.java:87)
	at com.intellij.openapi.editor.actionSystem.DynamicEditorActionHandler.doExecute(DynamicEditorActionHandler.java:52)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.lambda$execute$4(EditorActionHandler.java:199)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.doIfEnabled(EditorActionHandler.java:89)
	at com.intellij.openapi.editor.actionSystem.EditorActionHandler.execute(EditorActionHandler.java:198)
	at com.intellij.openapi.editor.actionSystem.EditorAction.lambda$actionPerformed$0(EditorAction.java:89)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:216)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:172)
	at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:98)
	at com.intellij.openapi.editor.actionSystem.EditorAction.actionPerformed(EditorAction.java:73)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAware$5(ActionUtil.java:273)
	at com.intellij.util.SlowOperations.lambda$allowSlowOperations$0(SlowOperations.java:77)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:64)
	at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:76)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:273)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:616)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$3(IdeKeyEventDispatcher.java:676)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:675)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:626)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:486)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:481)
	at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:232)
	at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:889)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:833)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.io.IOException: Font transform has NaN position
	at java.desktop/sun.lwawt.macosx.CClipboard.getClipboardData(Native Method)
	at java.desktop/sun.awt.datatransfer.ClipboardTransferable.fetchOneFlavor(ClipboardTransferable.java:107)
	at java.desktop/sun.awt.datatransfer.ClipboardTransferable.lambda$new$0(ClipboardTransferable.java:90)
	at java.base/java.util.HashMap$EntrySet.forEach(HashMap.java:1039)
	at java.desktop/sun.awt.datatransfer.ClipboardTransferable.<init>(ClipboardTransferable.java:90)
	at java.desktop/sun.awt.datatransfer.SunClipboard.getContents(SunClipboard.java:138)
	at java.desktop/sun.lwawt.macosx.CClipboard.getContents(CClipboard.java:62)
	at com.intellij.ide.ClipboardSynchronizer$ClipboardHandler.getContents(ClipboardSynchronizer.java:136)
	at com.intellij.ide.ClipboardSynchronizer$MacClipboardHandler.doGetContents(ClipboardSynchronizer.java:180)
	at com.intellij.ide.ClipboardSynchronizer$MacClipboardHandler.getContents(ClipboardSynchronizer.java:192)
	at com.intellij.openapi.application.ex.ClipboardUtil.handleClipboardSafely(ClipboardUtil.java:18)
	at com.intellij.ide.ClipboardSynchronizer.getContents(ClipboardSynchronizer.java:78)
	at com.intellij.ide.CopyPasteManagerEx.getContents(CopyPasteManagerEx.java:248)
	at com.jetbrains.rdserver.clipboard.BackendCopyPasteManager.getContents(BackendCopyPasteManager.kt:66)
	at org.intellij.images.ide.ImagePasteProvider.performPaste(ImagePasteProvider.kt:39)
	... 43 more

env: IntelliJ IDEA 2021.1.1 (Ultimate Edition) Build #IU-211.7142.45, built on April 30, 2021

Runtime version: 11.0.10+9-b1341.41 x86_64 VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o. macOS 10.15.6 GC: ParNew, ConcurrentMarkSweep Memory: 3014M Cores: 4 Non-Bundled Plugins: IdeaVIM (0.66), com.1v0.dev.hugo-intellij-plugin (0.4.1), com.github.holgerbrandl.pasteimages/ (1.2.6), google-java-format (1.9.0.1), org.toml.lang (0.2.146.3826-211), com.github.pshirshov.bytecodeeditor (0.2.1), com.dubreuia (2.2.0), org.jetbrains.plugins.vue (211.7142.13), org.jetbrains.kotlin (211-1.5.0-release-759-IJ6693.72), cn.wuzhizhan.plugin.mybatis (2020.12.18), Pythonid (211.7142.45) Kotlin: 211-1.5.0-release-759-IJ6693.72

brothertao avatar Jun 24 '21 06:06 brothertao

I can't reproduce it. Could you describe how to prepare the clipboard content?

holgerbrandl avatar Apr 19 '22 16:04 holgerbrandl

Same here.

To reproduce, open an image in KDE Gwenview, hit ctrl+c, then try to paste in Intellij. Intellij hangs for maybe one minute, before throwing the error.

tomsquest avatar Oct 24 '22 07:10 tomsquest

Thanks I'll have look as soon as possible.

holgerbrandl avatar Nov 07 '22 20:11 holgerbrandl