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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Labels:

      Description

      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.

        Attachments

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

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported: