Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8113362

Clipboard.getSystemClipboard().placeImage() either throws IllegalArgumentException or does nothing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • fx2.0
    • fx2.0
    • javafx

      If I run the attached problem and click the "Copy" button, the following exception appears in stderr:

      java.lang.IllegalArgumentException: Wrong byte buffer size 213x139 [118428] != 88821
      at com.sun.glass.ui.Pixels.<init>(Pixels.java:64)
      at com.sun.glass.ui.win.WinPixels.<init>(WinPixels.java:20)
      at com.sun.glass.ui.win.WinApplication.createPixels(WinApplication.java:107)
      at com.sun.javafx.tk.quantum.PixelUtils.imageToPixels(PixelUtils.java:28)
      at com.sun.javafx.tk.quantum.GlassClipboard.placeImage(GlassClipboard.java:223)
      at clipboardtest.Main$1.handle(Main.java:38)
      at clipboardtest.Main$1.handle(Main.java:35)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:59)
      ...

      Interestingly, if I switch from "new Image(getClass().getResourceAsStream("test.png"))" to "new Image("http://www.oracleimg.com/us/assets/oralogo-small.gif")", placeImage() stops failing but apparently has no effect, that is, does no place anything on the system clipboard.

      The HelloImageClipboard toy has a similar problem.

        1. Main.java
          2 kB
        2. test.png
          test.png
          2 kB

            morris Morris Meyer (Inactive)
            vbaranov Vasiliy Baranov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: