{"action":"created","issue":{"url":"https://api.github.com/repos/sksamuel/scrimage/issues/84","labels_url":"https://api.github.com/repos/sksamuel/scrimage/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/sksamuel/scrimage/issues/84/comments","events_url":"https://api.github.com/repos/sksamuel/scrimage/issues/84/events","html_url":"https://github.com/sksamuel/scrimage/issues/84","id":90079041,"number":84,"title":"IIOException writing a JPEG on OpenJDK","user":{"login":"avdv","id":3471749,"avatar_url":"https://avatars.githubusercontent.com/u/3471749?v=3","gravatar_id":"","url":"https://api.github.com/users/avdv","html_url":"https://github.com/avdv","followers_url":"https://api.github.com/users/avdv/followers","following_url":"https://api.github.com/users/avdv/following{/other_user}","gists_url":"https://api.github.com/users/avdv/gists{/gist_id}","starred_url":"https://api.github.com/users/avdv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avdv/subscriptions","organizations_url":"https://api.github.com/users/avdv/orgs","repos_url":"https://api.github.com/users/avdv/repos","events_url":"https://api.github.com/users/avdv/events{/privacy}","received_events_url":"https://api.github.com/users/avdv/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-22T11:56:20Z","updated_at":"2015-06-24T20:32:55Z","closed_at":"2015-06-24T20:32:54Z","body":"I wanted to upgrade to version 2.0 (thanks for your effort BTW!).\r\n\r\nThe old code works fine (version 1.4.2):\r\n\r\n```scala\r\nimg.write(new File(\"/tmp/out.jpeg\"), Format.JPEG)\r\n```\r\n\r\nMigrating the code to the new API, thusly:\r\n\r\n```scala\r\nval writer = JpegWriter()\r\nimg.output(new File(\"/tmp/out.jpeg\"))(writer)\r\n```\r\n\r\nthrows an exception using OpenJDK Runtime Environment (build 1.8.0_45-b14) but works on Oracle's JVM.\r\n\r\n```\r\njavax.imageio.IIOException: Invalid argument to native writeImage\r\n  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)\r\n  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeOnThread(JPEGImageWriter.java:1063)\r\n  at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:365)\r\n  at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriter.write(Unknown Source)\r\n  at com.sksamuel.scrimage.nio.JpegWriter.write(JpegWriter.scala:41)\r\n  at com.sksamuel.scrimage.WriteContext.write(WriteContext.scala:25)\r\n  at com.sksamuel.scrimage.WriteContext.write(WriteContext.scala:19)\r\n  at com.sksamuel.scrimage.Image.output(Image.scala:310)\r\n```\r\n\r\nAccording to http://stackoverflow.com/a/17845696/4432837 this is due to the fact that OpenJDK does not support JPEGs with alpha value, AFAIUI.\r\n\r\nI understand that this is not directly scrimage's fault; but, has something changed to make it no longer work in the new version?\r\n\r\nSeems I can work-around by explicitly specifying the type of the Image, as in `Image(bytes,  BufferedImage.TYPE_3BYTE_BGR)`."},"comment":{"url":"https://api.github.com/repos/sksamuel/scrimage/issues/comments/115002400","html_url":"https://github.com/sksamuel/scrimage/issues/84#issuecomment-115002400","issue_url":"https://api.github.com/repos/sksamuel/scrimage/issues/84","id":115002400,"user":{"login":"sksamuel","id":743706,"avatar_url":"https://avatars.githubusercontent.com/u/743706?v=3","gravatar_id":"","url":"https://api.github.com/users/sksamuel","html_url":"https://github.com/sksamuel","followers_url":"https://api.github.com/users/sksamuel/followers","following_url":"https://api.github.com/users/sksamuel/following{/other_user}","gists_url":"https://api.github.com/users/sksamuel/gists{/gist_id}","starred_url":"https://api.github.com/users/sksamuel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sksamuel/subscriptions","organizations_url":"https://api.github.com/users/sksamuel/orgs","repos_url":"https://api.github.com/users/sksamuel/repos","events_url":"https://api.github.com/users/sksamuel/events{/privacy}","received_events_url":"https://api.github.com/users/sksamuel/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T20:32:54Z","updated_at":"2015-06-24T20:32:54Z","body":"Ok added fix. Will include in 2.0.1 and 2.1.0"}}