{"action":"created","issue":{"url":"https://api.github.com/repos/qzind/tray/issues/72","repository_url":"https://api.github.com/repos/qzind/tray","labels_url":"https://api.github.com/repos/qzind/tray/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/qzind/tray/issues/72/comments","events_url":"https://api.github.com/repos/qzind/tray/issues/72/events","html_url":"https://github.com/qzind/tray/issues/72","id":164445397,"number":72,"title":"Hard crash printing large images","user":{"login":"tresf","id":6345473,"avatar_url":"https://avatars.githubusercontent.com/u/6345473?v=3","gravatar_id":"","url":"https://api.github.com/users/tresf","html_url":"https://github.com/tresf","followers_url":"https://api.github.com/users/tresf/followers","following_url":"https://api.github.com/users/tresf/following{/other_user}","gists_url":"https://api.github.com/users/tresf/gists{/gist_id}","starred_url":"https://api.github.com/users/tresf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tresf/subscriptions","organizations_url":"https://api.github.com/users/tresf/orgs","repos_url":"https://api.github.com/users/tresf/repos","events_url":"https://api.github.com/users/tresf/events{/privacy}","received_events_url":"https://api.github.com/users/tresf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/qzind/tray/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-08T02:06:22Z","updated_at":"2016-07-20T01:42:35Z","closed_at":null,"body":"This affects 2.0.0-stable.\r\n\r\nWhen using the image printing feature, the image is scaled to `8.3x` zoom regardless of it's original size.\r\n\r\nSample `1700 x 2387 px` image [here](https://cloud.githubusercontent.com/assets/6345473/16675414/b328ef10-448e-11e6-827a-09d193488bbd.png).  When this image is printed, it attempts to scale to `8.3x`, which yields `14,110 x 19,812 px` image which crashes the JVM. \r\n\r\nIntroduced with the following commit: https://github.com/qzind/tray/commit/04494188f859d956af28f55922b291850c3e773e\r\n\r\n```diff\r\n[DEBUG] 2016-07-07 21:30:32,871 @ qz.utils.PrintingUtilities:?\r\n        Found Resolution: 60000x60000 dphi\r\n[DEBUG] 2016-07-07 21:30:33,335 @ qz.printer.action.PrintImage:?\r\n+       Scaling image up by x8.333333333333334\r\n[ERROR] 2016-07-07 21:30:33,676 @ qz.ws.PrintSocketClient:?\r\n        Connection error\r\njava.lang.RuntimeException: Cannot call method public void qz.ws.PrintSocketClient#onMessage(org.eclipse.jetty.websocket.api.Session, java.io.Reader) with args: [org.eclipse.jetty.websocket.common.WebSocketSession, org.eclipse.jetty.websocket.common.message.MessageReader]\r\n        at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.unwrapRuntimeException(CallableMethod.java:93)\r\n        at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:75)\r\n        at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:68)\r\n        at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver$2.run(JettyAnnotatedEventDriver.java:210)\r\n        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\r\n        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\r\n        at java.lang.Thread.run(Unknown Source)\r\nCaused by: java.lang.OutOfMemoryError: Java heap space\r\n        at java.awt.image.DataBufferByte.<init>(Unknown Source)\r\n        at java.awt.image.Raster.createInterleavedRaster(Unknown Source)\r\n        at java.awt.image.BufferedImage.<init>(Unknown Source)\r\n        at qz.printer.action.PrintImage.parseData(Unknown Source)\r\n        at qz.ws.PrintSocketClient.processPrintRequest(Unknown Source)\r\n        at qz.ws.PrintSocketClient.processMessage(Unknown Source)\r\n        at qz.ws.PrintSocketClient.onMessage(Unknown Source)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)\r\n        at java.lang.reflect.Method.invoke(Unknown Source)\r\n        at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:70)\r\n        ... 5 more\r\n```"},"comment":{"url":"https://api.github.com/repos/qzind/tray/issues/comments/233816231","html_url":"https://github.com/qzind/tray/issues/72#issuecomment-233816231","issue_url":"https://api.github.com/repos/qzind/tray/issues/72","id":233816231,"user":{"login":"tresf","id":6345473,"avatar_url":"https://avatars.githubusercontent.com/u/6345473?v=3","gravatar_id":"","url":"https://api.github.com/users/tresf","html_url":"https://github.com/tresf","followers_url":"https://api.github.com/users/tresf/followers","following_url":"https://api.github.com/users/tresf/following{/other_user}","gists_url":"https://api.github.com/users/tresf/gists{/gist_id}","starred_url":"https://api.github.com/users/tresf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tresf/subscriptions","organizations_url":"https://api.github.com/users/tresf/orgs","repos_url":"https://api.github.com/users/tresf/repos","events_url":"https://api.github.com/users/tresf/events{/privacy}","received_events_url":"https://api.github.com/users/tresf/received_events","type":"User","site_admin":false},"created_at":"2016-07-20T01:42:35Z","updated_at":"2016-07-20T01:42:35Z","body":"> This prints much faster now (about 30 seconds) after that commit.\r\n\r\nKyle and I were testing with a proprietary image which was rendered at 200dpi.  It appears Java isn't handling the 200dpi very well and from research, it's just less fuss to have the clients use 72dpi images.\r\n\r\nIn my testing with a 200dpi image, printing took 20 seconds.  At 72dpi, printing took 6 seconds.\r\n\r\nI also forced nearest neighbor which should be slightly faster rendering and better barcode scan-ability.\r\n\r\nI'll create a test build for the client and see if the results are acceptable."}}
{"actor":{"display_login":"tresf"}}