{"action":"created","comment":{"url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/comments/92512765","pull_request_review_id":13029893,"id":92512765,"diff_hunk":"@@ -0,0 +1,147 @@\n+package net.pms.util;\n+\n+import java.awt.image.BufferedImage;\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.util.Iterator;\n+import java.util.Locale;\n+import javax.imageio.IIOException;\n+import javax.imageio.ImageIO;\n+import javax.imageio.ImageReadParam;\n+import javax.imageio.ImageReader;\n+import javax.imageio.spi.IIORegistry;\n+import javax.imageio.spi.ImageInputStreamSpi;\n+import javax.imageio.stream.ImageInputStream;\n+import net.pms.util.ImagesUtil.ImageFormat;\n+\n+/**\n+ * This is a hack of a utility class created because whoever wrote {@link ImageIO}\n+ * decided to make it {@code final}. The sole purpose of these methods is to\n+ * return the image format of the source image along with the {@link BufferedImage}.\n+ *\n+ * There should be no reason to have to do this twice, and thus the result from\n+ * the analysis done when reading the image is kept.\n+ */\n+public class CustomImageReader {\n+\n+    protected static final IIORegistry theRegistry = IIORegistry.getDefaultInstance();\n+\n+\t// Not to be instantiated\n+\tprivate CustomImageReader() {\n+\t}\n+\n+\t/**\n+\t * A copy of {@link ImageIO#read(InputStream)} that calls {{@link #read(ImageInputStream)}\n+\t * instead of {@link ImageIO#read(ImageInputStream)}.\n+\t *\n+\t * @see ImageIO#read(InputStream)\n+\t */\n+    public static ImageReaderResult read(InputStream input) throws IOException {\n+        if (input == null) {\n+            throw new IllegalArgumentException(\"input == null!\");\n+        }\n+\n+        ImageInputStream stream = createImageInputStream(input);\n+        ImageReaderResult result = read(stream);\n+        if (result.bufferedImage == null) {","path":"src/main/java/net/pms/util/CustomImageReader.java","position":46,"original_position":46,"commit_id":"be464c25dad65b6252fb75c586b45b9d2ed4edba","original_commit_id":"be464c25dad65b6252fb75c586b45b9d2ed4edba","user":{"login":"Nadahar","id":12900583,"avatar_url":"https://avatars.githubusercontent.com/u/12900583?v=3","gravatar_id":"","url":"https://api.github.com/users/Nadahar","html_url":"https://github.com/Nadahar","followers_url":"https://api.github.com/users/Nadahar/followers","following_url":"https://api.github.com/users/Nadahar/following{/other_user}","gists_url":"https://api.github.com/users/Nadahar/gists{/gist_id}","starred_url":"https://api.github.com/users/Nadahar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nadahar/subscriptions","organizations_url":"https://api.github.com/users/Nadahar/orgs","repos_url":"https://api.github.com/users/Nadahar/repos","events_url":"https://api.github.com/users/Nadahar/events{/privacy}","received_events_url":"https://api.github.com/users/Nadahar/received_events","type":"User","site_admin":false},"body":"@Sami32 I can't get that image to work nomatter what I do. Is the format valid? I can see that Windows can render it, but that doesn't mean it's valid. Does it have some unusual characteristic that we need to try to detect?\r\n\r\nI've updated Twelvemonkeys' ImageIO plugins to the latest version (3.3.1) and it doesn't help. ImageIO manages to read it into a BufferedImage, but that must be corrupted somehow because trying to write that BufferedImage to either a TIFF or a JPEG fails.\r\n\r\nI've made some corrections (not pushed yet) to handle it a little bit better, but there's not much I can do as the errors ImageIO throws aren't really usedful (```ArrayIndexOutOfBoundsException``` when trying to write TIFF and \"```IIOException```: Invalid argument to native writeImage\" when trying to write JPEG).\r\n\r\nGiven that the image is valid, you could try to post an issue with [TwelveMonkeys](https://github.com/haraldk/TwelveMonkeys/issues).","created_at":"2016-12-14T23:17:02Z","updated_at":"2016-12-14T23:17:02Z","html_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/1061#discussion_r92512765","pull_request_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061","_links":{"self":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/comments/92512765"},"html":{"href":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/1061#discussion_r92512765"},"pull_request":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061"}}},"pull_request":{"url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061","id":90464520,"html_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/1061","diff_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/1061.diff","patch_url":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/1061.patch","issue_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/1061","number":1061,"state":"open","locked":false,"title":"Show generic icons for media whose don't provide thumbnails","user":{"login":"valib","id":1472678,"avatar_url":"https://avatars.githubusercontent.com/u/1472678?v=3","gravatar_id":"","url":"https://api.github.com/users/valib","html_url":"https://github.com/valib","followers_url":"https://api.github.com/users/valib/followers","following_url":"https://api.github.com/users/valib/following{/other_user}","gists_url":"https://api.github.com/users/valib/gists{/gist_id}","starred_url":"https://api.github.com/users/valib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valib/subscriptions","organizations_url":"https://api.github.com/users/valib/orgs","repos_url":"https://api.github.com/users/valib/repos","events_url":"https://api.github.com/users/valib/events{/privacy}","received_events_url":"https://api.github.com/users/valib/received_events","type":"User","site_admin":false},"body":"Show generic icons (thumbnails) for media whose don't provide  thumbnails or  thumbnails are not generated for them like  audio files wihout CoverArt. It can be simply updated by addding images with convention \"media format\".png and \"media format\".jpg to the resources/images folder. Images I provided in this commit are only for testing because I think  that they could be changed to something better.\n","created_at":"2016-10-22T01:03:39Z","updated_at":"2016-12-14T23:17:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8615a1f4f7ba6af9bff4dec32ae28331dca640c0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061/commits","review_comments_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061/comments","review_comment_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/1061/comments","statuses_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/statuses/be464c25dad65b6252fb75c586b45b9d2ed4edba","head":{"label":"UniversalMediaServer:show_generic_icons","ref":"show_generic_icons","sha":"be464c25dad65b6252fb75c586b45b9d2ed4edba","user":{"login":"UniversalMediaServer","id":1840565,"avatar_url":"https://avatars.githubusercontent.com/u/1840565?v=3","gravatar_id":"","url":"https://api.github.com/users/UniversalMediaServer","html_url":"https://github.com/UniversalMediaServer","followers_url":"https://api.github.com/users/UniversalMediaServer/followers","following_url":"https://api.github.com/users/UniversalMediaServer/following{/other_user}","gists_url":"https://api.github.com/users/UniversalMediaServer/gists{/gist_id}","starred_url":"https://api.github.com/users/UniversalMediaServer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniversalMediaServer/subscriptions","organizations_url":"https://api.github.com/users/UniversalMediaServer/orgs","repos_url":"https://api.github.com/users/UniversalMediaServer/repos","events_url":"https://api.github.com/users/UniversalMediaServer/events{/privacy}","received_events_url":"https://api.github.com/users/UniversalMediaServer/received_events","type":"Organization","site_admin":false},"repo":{"id":4591214,"name":"UniversalMediaServer","full_name":"UniversalMediaServer/UniversalMediaServer","owner":{"login":"UniversalMediaServer","id":1840565,"avatar_url":"https://avatars.githubusercontent.com/u/1840565?v=3","gravatar_id":"","url":"https://api.github.com/users/UniversalMediaServer","html_url":"https://github.com/UniversalMediaServer","followers_url":"https://api.github.com/users/UniversalMediaServer/followers","following_url":"https://api.github.com/users/UniversalMediaServer/following{/other_user}","gists_url":"https://api.github.com/users/UniversalMediaServer/gists{/gist_id}","starred_url":"https://api.github.com/users/UniversalMediaServer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniversalMediaServer/subscriptions","organizations_url":"https://api.github.com/users/UniversalMediaServer/orgs","repos_url":"https://api.github.com/users/UniversalMediaServer/repos","events_url":"https://api.github.com/users/UniversalMediaServer/events{/privacy}","received_events_url":"https://api.github.com/users/UniversalMediaServer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UniversalMediaServer/UniversalMediaServer","description":"A DLNA-compliant UPnP Media Server.","fork":false,"url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer","forks_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/forks","keys_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/teams","hooks_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/hooks","issue_events_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/events{/number}","events_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/events","assignees_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/assignees{/user}","branches_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/branches{/branch}","tags_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/tags","blobs_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/statuses/{sha}","languages_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/languages","stargazers_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/stargazers","contributors_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/contributors","subscribers_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/subscribers","subscription_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/subscription","commits_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/contents/{+path}","compare_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/merges","archive_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/downloads","issues_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues{/number}","pulls_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls{/number}","milestones_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/milestones{/number}","notifications_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/labels{/name}","releases_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/releases{/id}","deployments_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/deployments","created_at":"2012-06-07T22:23:22Z","updated_at":"2016-12-14T12:14:52Z","pushed_at":"2016-12-14T15:29:53Z","git_url":"git://github.com/UniversalMediaServer/UniversalMediaServer.git","ssh_url":"git@github.com:UniversalMediaServer/UniversalMediaServer.git","clone_url":"https://github.com/UniversalMediaServer/UniversalMediaServer.git","svn_url":"https://github.com/UniversalMediaServer/UniversalMediaServer","homepage":null,"size":36627,"stargazers_count":453,"watchers_count":453,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":175,"mirror_url":null,"open_issues_count":274,"forks":175,"open_issues":274,"watchers":453,"default_branch":"master"}},"base":{"label":"UniversalMediaServer:master","ref":"master","sha":"78727617308731681bafbe20ab11f03b4a58d1f0","user":{"login":"UniversalMediaServer","id":1840565,"avatar_url":"https://avatars.githubusercontent.com/u/1840565?v=3","gravatar_id":"","url":"https://api.github.com/users/UniversalMediaServer","html_url":"https://github.com/UniversalMediaServer","followers_url":"https://api.github.com/users/UniversalMediaServer/followers","following_url":"https://api.github.com/users/UniversalMediaServer/following{/other_user}","gists_url":"https://api.github.com/users/UniversalMediaServer/gists{/gist_id}","starred_url":"https://api.github.com/users/UniversalMediaServer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniversalMediaServer/subscriptions","organizations_url":"https://api.github.com/users/UniversalMediaServer/orgs","repos_url":"https://api.github.com/users/UniversalMediaServer/repos","events_url":"https://api.github.com/users/UniversalMediaServer/events{/privacy}","received_events_url":"https://api.github.com/users/UniversalMediaServer/received_events","type":"Organization","site_admin":false},"repo":{"id":4591214,"name":"UniversalMediaServer","full_name":"UniversalMediaServer/UniversalMediaServer","owner":{"login":"UniversalMediaServer","id":1840565,"avatar_url":"https://avatars.githubusercontent.com/u/1840565?v=3","gravatar_id":"","url":"https://api.github.com/users/UniversalMediaServer","html_url":"https://github.com/UniversalMediaServer","followers_url":"https://api.github.com/users/UniversalMediaServer/followers","following_url":"https://api.github.com/users/UniversalMediaServer/following{/other_user}","gists_url":"https://api.github.com/users/UniversalMediaServer/gists{/gist_id}","starred_url":"https://api.github.com/users/UniversalMediaServer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniversalMediaServer/subscriptions","organizations_url":"https://api.github.com/users/UniversalMediaServer/orgs","repos_url":"https://api.github.com/users/UniversalMediaServer/repos","events_url":"https://api.github.com/users/UniversalMediaServer/events{/privacy}","received_events_url":"https://api.github.com/users/UniversalMediaServer/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UniversalMediaServer/UniversalMediaServer","description":"A DLNA-compliant UPnP Media Server.","fork":false,"url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer","forks_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/forks","keys_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/teams","hooks_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/hooks","issue_events_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/events{/number}","events_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/events","assignees_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/assignees{/user}","branches_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/branches{/branch}","tags_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/tags","blobs_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/statuses/{sha}","languages_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/languages","stargazers_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/stargazers","contributors_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/contributors","subscribers_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/subscribers","subscription_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/subscription","commits_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/contents/{+path}","compare_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/merges","archive_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/downloads","issues_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues{/number}","pulls_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls{/number}","milestones_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/milestones{/number}","notifications_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/labels{/name}","releases_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/releases{/id}","deployments_url":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/deployments","created_at":"2012-06-07T22:23:22Z","updated_at":"2016-12-14T12:14:52Z","pushed_at":"2016-12-14T15:29:53Z","git_url":"git://github.com/UniversalMediaServer/UniversalMediaServer.git","ssh_url":"git@github.com:UniversalMediaServer/UniversalMediaServer.git","clone_url":"https://github.com/UniversalMediaServer/UniversalMediaServer.git","svn_url":"https://github.com/UniversalMediaServer/UniversalMediaServer","homepage":null,"size":36627,"stargazers_count":453,"watchers_count":453,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":175,"mirror_url":null,"open_issues_count":274,"forks":175,"open_issues":274,"watchers":453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061"},"html":{"href":"https://github.com/UniversalMediaServer/UniversalMediaServer/pull/1061"},"issue":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/1061"},"comments":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/issues/1061/comments"},"review_comments":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061/comments"},"review_comment":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/pulls/1061/commits"},"statuses":{"href":"https://api.github.com/repos/UniversalMediaServer/UniversalMediaServer/statuses/be464c25dad65b6252fb75c586b45b9d2ed4edba"}}}}
{"actor":{"display_login":"Nadahar"}}