Cannot Attach Screenshots In OSX

Create issue
Issue #1 open
William Roush repo owner created an issue

Reported by: John Pataki


I've recently updated to latest release of JAVA on my Macbook Pro and now when I use this plugin, it doesn't seem to be capturing the clipboard correctly or at all. The preview during image capture doesn't show the clipboard contents and while images appear to be saved, they are blank / transparent nothingness.

Has anyone else noticed this? Will there be an update to accommodate the most recent JAVA for OSX (Snow Leopard) update?

java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527) Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)


I'll need some kind of Java console output (there is code here to print stack traces in case of an error), or an OSX machine (in case one of the various conditions before the errors is causing it to bail early).

I'll attempt to replicate this on Linux on Monday, if I can, I'll fix it, if not, I'll have to wait for more details or someone with an OSX machine to contribute a fix.

However looking at the code, it definitely looks like the screenshot is never captured correctly, so once I figure out why it isn't being correctly captured, it should be an easy fix.

Comments (9)

  1. William Roush reporter

    This line seems to be writing zero bytes in OSX:

    ImageIO.write(image, "png", outStream);
    

    Joe Cullin reports:

    Googling for ImageIO on mac, I see some vague complaints about how mac java is not kept up to date. I have the latest available from Apple. Maybe there's a way to upgrade unofficially, but I'm not sure I want to risk breaking other things.


    I'll figure out another method I can do to get this working, hopefully Linux is in as bad a shape and I can replicate it, if not I'll just have to stay as far away from ImageIO as possible to get it fixed the first time.

  2. Former user Account Deleted

    Hy there, I am also troubled by this problem, have you found any solution already? Thanks a lot :)

  3. hejsan

    I have the same problem on snow leopard and java version "1.6.0_35" I tried it on firefox and chrome.

  4. Sergey Vasilyev

    Same for me. It works fine with MS Windows and Internet Explorer, but fails to work with Mac OS X 10.8 (both Safari and Chrome) with default Apple Java 1.6.

    When I click 'Add' on the issue, it shows the popup frame and shows an image properly (I guess this is the Java side). But when I click 'Add' inside the frame, it shows the empty thumbnail, and the real image is actually never stored on the server.

    To be more specific, .../redmine/tmp/ folder contains 5KB png files for 1440x900 images (should be ≈120KB+ when they come from Windows); these files have proper(!) image dimensions (1440x900), but zeros instead of the data inside (png headers looks fine). Two sample files have been just uploaded above.

    If I install Java 1.7, it has issues with empty image even in the popup frame in Safari, and it officially does not work with Chrome. Anyway, I cannot ask all my users to tweak their MacOSXes, so this is not a solution anyway.

    Client-side (Mac OS X 10.8):

    $ java -version
    java version "1.6.0_37"
    Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909)
    Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)
    

    Server-side (Redhat, RVM, Redmine 2.2.0):

    $ ruby --version; rails --version; gem list
    ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-linux]
    Rails 3.2.9
    
    *** LOCAL GEMS ***
    
    actionmailer (3.2.9, 3.2.8)
    actionpack (3.2.9, 3.2.8)
    activemodel (3.2.9, 3.2.8)
    activerecord (3.2.9, 3.2.8)
    activeresource (3.2.9, 3.2.8)
    activesupport (3.2.9, 3.2.8)
    arel (3.0.2)
    builder (3.0.4, 3.0.0)
    bundler (1.2.3)
    coderay (1.0.8)
    erubis (2.7.0)
    hike (1.2.1)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (2.0.3)
    json (1.7.6)
    krb5-auth (0.7)
    mail (2.4.4)
    metaclass (0.0.1)
    mime-types (1.19)
    mocha (0.12.3)
    multi_json (1.5.0)
    mysql2 (0.3.11)
    net-ldap (0.3.1)
    pg (0.14.1)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.2)
    rack-openid (1.3.1)
    rack-ssl (1.3.2)
    rack-test (0.6.2)
    rails (3.2.9, 3.2.8)
    railties (3.2.9, 3.2.8)
    rake (10.0.3)
    rdoc (3.12)
    rmagick (2.13.1)
    ruby-openid (2.1.8)
    rubygems-bundler (1.1.0)
    rvm (1.11.3.5)
    shoulda (2.11.3)
    sprockets (2.2.2, 2.1.3)
    sqlite3 (1.3.6)
    test-unit (2.5.3)
    thor (0.16.0)
    tilt (1.3.3)
    treetop (1.4.12)
    tzinfo (0.3.35)
    yard (0.8.3)
    

    Log fragment when I click the 'Add' button for the second time (the server is started as ruby script/rails server webrick -e production):

    Started POST "/attach_screenshot" for 192.168.167.14 at 2013-01-01 19:39:44 +0300
    Processing by AttachScreenshotController#index as HTML
      Parameters: {"attachments"=>#<ActionDispatch::Http::UploadedFile:0x00000014e66130 @original_filename="screenshot.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"attachments\"; filename=\"screenshot.png\"\r\nContent-Type: image/png\r\n", @tempfile=#<File:/tmp/RackMultipart20130101-2368-1188cts>>}
      Current user: anonymous
      Rendered inline template (1.1ms)
    Completed 200 OK in 105ms (Views: 3.5ms | ActiveRecord: 0.8ms)
    Started GET "/attach_screenshot?id=484_193944.000000thumb.png" for 192.168.167.14 at 2013-01-01 19:39:44 +0300
    Processing by AttachScreenshotController#index as */*
      Parameters: {"id"=>"484_193944.000000thumb.png"}
      Current user: test (id=485)
    Sent file /u01/site/www/redmine-2.2.0/tmp/484_193944.000000thumb.png (0.1ms)
    Completed 200 OK in 4ms (ActiveRecord: 0.7ms)
    
  5. Log in to comment