comp500 / ScreenshotToClipboard

Screenshots taken are copied to the clipboard.
https://www.curseforge.com/minecraft/mc-mods/screenshot-to-clipboard
MIT License
33 stars 1 forks source link

Funky error in log on 1.14.x (probably not a problem) #4

Closed comp500 closed 5 years ago

comp500 commented 5 years ago

Log: https://paste.ee/p/GO6HK

[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]: java.io.IOException: Registered service providers failed to encode BufferedImage@40cc5911: type = 0 ColorModel: #pixelBits = 32 numComponents = 4 color space = java.awt.color.ICC_ColorSpace@5f520428 transparency = 3 has alpha = true isAlphaPre = false ByteInterleavedRaster: width = 854 height = 480 #numDataElements 4 dataOff[0] = 0 to image/jpeg
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.desktop/sun.awt.datatransfer.DataTransferer.imageToStandardBytesImpl(DataTransferer.java:1799)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.desktop/sun.awt.datatransfer.DataTransferer.imageToStandardBytes(DataTransferer.java:1713)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.desktop/sun.awt.windows.WDataTransferer.imageToPlatformBytes(WDataTransferer.java:353)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.desktop/sun.awt.datatransfer.DataTransferer.translateTransferable(DataTransferer.java:855)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.desktop/sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer.java:220)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.desktop/sun.awt.windows.WClipboard.setContentsNative(WClipboard.java:83)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.desktop/sun.awt.datatransfer.SunClipboard.setContents(SunClipboard.java:105)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at link.infra.screenshotclipboard.ScreenshotToClipboard.lambda$doCopy$0(ScreenshotToClipboard.java:107)
[00:01:43] [Screenshot to Clipboard Copy/INFO]: [STDERR]:   at java.base/java.lang.Thread.run(Thread.java:834)

Very funky indeed, but the screenshot still captures! I don't think it's really an issue that can cause problems (for now, at least), but I've made this issue in case it causes problems later and/or anyone else finds this.

comp500 commented 5 years ago

On AdoptOpenJDK 8 (OpenJ9) on 1.14.4 Fabric, I get a different but still strange error, and the screenshot still copies!

javax.imageio.IIOException: Invalid argument to native writeImage
    at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
    at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1067)
    at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:363)
    at javax.imageio.ImageWriter.write(ImageWriter.java:615)
    at sun.awt.datatransfer.DataTransferer.imageToStandardBytesImpl(DataTransferer.java:2215)
    at sun.awt.datatransfer.DataTransferer.imageToStandardBytes(DataTransferer.java:2145)
    at sun.awt.windows.WDataTransferer.imageToPlatformBytes(WDataTransferer.java:352)
    at sun.awt.datatransfer.DataTransferer.translateTransferable(DataTransferer.java:1223)
    at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer.java:219)
    at sun.awt.windows.WClipboard.setContentsNative(WClipboard.java:83)
    at sun.awt.datatransfer.SunClipboard.setContents(SunClipboard.java:106)
    at link.infra.screenshotclipboard.ScreenshotToClipboard.lambda$doCopy$0(ScreenshotToClipboard.java:107)
    at link.infra.screenshotclipboard.ScreenshotToClipboard$$Lambda$3102.00000000135A1550.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:819)
comp500 commented 5 years ago

Similar error in Forge 1.14.4-28.1.1 produced on AdoptOpenJDK Hotspot 1.8.0_222

[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]: javax.imageio.IIOException: Invalid argument to native writeImage
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1067)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:363)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at javax.imageio.ImageWriter.write(ImageWriter.java:615)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at sun.awt.datatransfer.DataTransferer.imageToStandardBytesImpl(DataTransferer.java:2215)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at sun.awt.datatransfer.DataTransferer.imageToStandardBytes(DataTransferer.java:2145)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at sun.awt.windows.WDataTransferer.imageToPlatformBytes(WDataTransferer.java:352)
[13Sep2019 12:39:01.712] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at sun.awt.datatransfer.DataTransferer.translateTransferable(DataTransferer.java:1223)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at sun.awt.windows.WDataTransferer.translateTransferable(WDataTransferer.java:219)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at sun.awt.windows.WClipboard.setContentsNative(WClipboard.java:83)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at sun.awt.datatransfer.SunClipboard.setContents(SunClipboard.java:106)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at link.infra.screenshotclipboard.ScreenshotToClipboard.lambda$doCopy$2(ScreenshotToClipboard.java:133)
[13Sep2019 12:39:01.713] [Screenshot to Clipboard Copy/INFO] [STDERR/]: [sun.awt.windows.WClipboard:setContentsNative:91]:  at java.lang.Thread.run(Thread.java:748)

Forge 1.14.x doesn't support OpenJ9.

comp500 commented 5 years ago

Fixing #5 should fix this.

IanMayo commented 5 years ago

I'm chasing a similar bug in my Java app. This article seems to explain the issue: http://www.jfree.org/forum/viewtopic.php?t=120416

comp500 commented 5 years ago

Thanks, I'll take a look.