{"action":"created","issue":{"url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/315","labels_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/315/labels{/name}","comments_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/315/comments","events_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/315/events","html_url":"https://github.com/kartik-v/bootstrap-fileinput/issues/315","id":86352522,"number":315,"title":"Error thrown while trying to select png file","user":{"login":"DaXmAn","id":3939431,"avatar_url":"https://avatars.githubusercontent.com/u/3939431?v=3","gravatar_id":"","url":"https://api.github.com/users/DaXmAn","html_url":"https://github.com/DaXmAn","followers_url":"https://api.github.com/users/DaXmAn/followers","following_url":"https://api.github.com/users/DaXmAn/following{/other_user}","gists_url":"https://api.github.com/users/DaXmAn/gists{/gist_id}","starred_url":"https://api.github.com/users/DaXmAn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaXmAn/subscriptions","organizations_url":"https://api.github.com/users/DaXmAn/orgs","repos_url":"https://api.github.com/users/DaXmAn/repos","events_url":"https://api.github.com/users/DaXmAn/events{/privacy}","received_events_url":"https://api.github.com/users/DaXmAn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-08T22:16:47Z","updated_at":"2015-06-11T09:10:40Z","closed_at":"2015-06-11T09:09:59Z","body":"plugin version 4.2.1, tested on both .min and not\r\njquery version 2.3.1\r\nbootstrap version 3.3.4\r\n\r\nBy selecting I mean selecting file via system/browser build-in file dialog.\r\n\r\n\r\nmy input definition:\r\n\r\n\t<input type=\"file\" id=\"xxx\" multiple=\"multiple\" name=\"xxx\" />\r\n\r\n\t$(\"#xxx\").fileinput({\r\n\t\tshowUpload: false,\r\n\t\tshowCaption: true,\r\n\t\tbrowseLabel: \"Add images\",\r\n\t\tbrowseClass: \"btn btn-default btn-sm\",\r\n\t\tremoveClass: \"btn btn-danger btn-sm\",\r\n\t\tcaptionClass: \"input-sm text-left\",\r\n\t\tremoveLabel: \"Clear\",\r\n\t\tallowedFileExtensions: ['jpg', 'png', 'gif'],\r\n\t\tallowedFileTypes: ['image'],\r\n\t\tpreviewFileIcon: \"<i class='glyphicon glyphicon-king'></i>\",\r\n\t\tinitialCaption: \"allowed files: jpg, png, gif; max. size per image: 580 kb; multi select allowed\",\r\n\t\toverwriteInitial: false,\r\n\t\tpreviewSettings: { image: { width: \"auto\", height: \"100px\" } },\r\n\t\tmaxFileSize: 580,\r\n\t\tmaxFileCount: 10\r\n\t});\r\n\r\nWhile trying to select PNG image, below error is thrown (jpg and gif works fine):\r\n\r\nUncaught TypeError: Cannot read property 'width' of undefined @ fileinput.js:1658\r\nFileInput.previewDefault @ fileinput.js:1658\r\nFileInput.readFiles.throwError @ fileinput.js:1741\r\nreadFile @ fileinput.js:1772\r\nFileInput.readFiles @ fileinput.js:1851\r\nFileInput.change @ fileinput.js:1956\r\njQuery.extend.proxy.proxy @ jquery-2.1.3.js:512\r\njQuery.event.dispatch @ jquery-2.1.3.js:4430\r\njQuery.event.add.elemData.handle @ jquery-2.1.3.js:4116\r\n\r\nFile preview is not shown if you select only one PNG. If you select working extension as first (for example jpg and gif and then PNG) you will end up with 2 image previews and below message:\r\n\"Loading file 2 of 3 - aaa.gif - 50% completed.\" and ofcourse mentioned js error."},"comment":{"url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/comments/111053267","html_url":"https://github.com/kartik-v/bootstrap-fileinput/issues/315#issuecomment-111053267","issue_url":"https://api.github.com/repos/kartik-v/bootstrap-fileinput/issues/315","id":111053267,"user":{"login":"kartik-v","id":3592619,"avatar_url":"https://avatars.githubusercontent.com/u/3592619?v=3","gravatar_id":"","url":"https://api.github.com/users/kartik-v","html_url":"https://github.com/kartik-v","followers_url":"https://api.github.com/users/kartik-v/followers","following_url":"https://api.github.com/users/kartik-v/following{/other_user}","gists_url":"https://api.github.com/users/kartik-v/gists{/gist_id}","starred_url":"https://api.github.com/users/kartik-v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kartik-v/subscriptions","organizations_url":"https://api.github.com/users/kartik-v/orgs","repos_url":"https://api.github.com/users/kartik-v/repos","events_url":"https://api.github.com/users/kartik-v/events{/privacy}","received_events_url":"https://api.github.com/users/kartik-v/received_events","type":"User","site_admin":false},"created_at":"2015-06-11T09:10:40Z","updated_at":"2015-06-11T09:10:40Z","body":"You may check now with the updated code from dev-master."}}