{"action":"created","issue":{"url":"https://api.github.com/repos/Foliotek/Croppie/issues/348","repository_url":"https://api.github.com/repos/Foliotek/Croppie","labels_url":"https://api.github.com/repos/Foliotek/Croppie/issues/348/labels{/name}","comments_url":"https://api.github.com/repos/Foliotek/Croppie/issues/348/comments","events_url":"https://api.github.com/repos/Foliotek/Croppie/issues/348/events","html_url":"https://github.com/Foliotek/Croppie/issues/348","id":242662708,"number":348,"title":"Issues of IndexSizeError in IE","user":{"login":"wuyingyou","id":13143669,"avatar_url":"https://avatars5.githubusercontent.com/u/13143669?v=4","gravatar_id":"","url":"https://api.github.com/users/wuyingyou","html_url":"https://github.com/wuyingyou","followers_url":"https://api.github.com/users/wuyingyou/followers","following_url":"https://api.github.com/users/wuyingyou/following{/other_user}","gists_url":"https://api.github.com/users/wuyingyou/gists{/gist_id}","starred_url":"https://api.github.com/users/wuyingyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuyingyou/subscriptions","organizations_url":"https://api.github.com/users/wuyingyou/orgs","repos_url":"https://api.github.com/users/wuyingyou/repos","events_url":"https://api.github.com/users/wuyingyou/events{/privacy}","received_events_url":"https://api.github.com/users/wuyingyou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-07-13T10:56:34Z","updated_at":"2017-07-14T14:09:58Z","closed_at":"2017-07-14T14:09:28Z","body":"Hi Guys,\r\n\r\nCould you please help to address this issue only in IE10/IE11 ?\r\n\r\n<img id='demoImg'  src='images/cat.jpg' />\r\n\r\n        var cropDemo = $('#demoImg').croppie({\r\n            viewport: {\r\n                width: 309,\r\n                height: 309,\r\n            },\r\n            boundary: {\r\n                width: 309,\r\n                height: 309\r\n            },\r\n            enforceBoundary: false,\r\n            customClass: 'square-image'\r\n        });\r\n\r\n\r\nHeads up for these 2 tips:\r\n1.  Viewport is the same to the boundary\r\n2.  enforceBoundary is false\r\n\r\nThen when we zoom out, say, 0.5 and move the picture to clip partially, the 'IndexSizeError' occurs. After we do some research, we found the root cause is in the API call \" ctx.drawImage(this.elements.preview, left, top, width, height, startX, startY, outWidth, outHeight);\", if the 'width'/'height' is greater than 'this.elements.preview's width or height, then we got the bug.\r\n\r\nWe want to add some code to fix this issue, but some times still does not work.\r\n\r\n .........  \r\n      var ua = window.navigator.userAgent;\r\n        var old_ie = ua.indexOf('MSIE ');\r\n        var new_ie = ua.indexOf('Trident/');\r\n        if ((old_ie > -1) || (new_ie > -1)) {\r\n            if (width > self._originalImageWidth) {\r\n                width = self._originalImageWidth - left;\r\n                outWidth = width;\r\n            }\r\n            if (height > self._originalImageHeight) {\r\n                height = self._originalImageHeight - top;\r\n                outHeight = height;\r\n            }\r\n        }\r\n   ctx.drawImage(this.elements.preview, left, top, width, height, startX, startY, outWidth, outHeight);\r\n.......\r\n\r\nAttached some screenshots and my IE is IE11.\r\n\r\n@manast @fdanielsen @bigamil @spookee86 @kmagiera , could some guys help to look at it? Appreciate your help.\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n   \r\n"},"comment":{"url":"https://api.github.com/repos/Foliotek/Croppie/issues/comments/315369077","html_url":"https://github.com/Foliotek/Croppie/issues/348#issuecomment-315369077","issue_url":"https://api.github.com/repos/Foliotek/Croppie/issues/348","id":315369077,"user":{"login":"thedustinsmith","id":1330308,"avatar_url":"https://avatars5.githubusercontent.com/u/1330308?v=4","gravatar_id":"","url":"https://api.github.com/users/thedustinsmith","html_url":"https://github.com/thedustinsmith","followers_url":"https://api.github.com/users/thedustinsmith/followers","following_url":"https://api.github.com/users/thedustinsmith/following{/other_user}","gists_url":"https://api.github.com/users/thedustinsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/thedustinsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thedustinsmith/subscriptions","organizations_url":"https://api.github.com/users/thedustinsmith/orgs","repos_url":"https://api.github.com/users/thedustinsmith/repos","events_url":"https://api.github.com/users/thedustinsmith/events{/privacy}","received_events_url":"https://api.github.com/users/thedustinsmith/received_events","type":"User","site_admin":false},"created_at":"2017-07-14T14:09:58Z","updated_at":"2017-07-14T14:09:58Z","body":"This will be fixed in the next release, thanks for pointing it out.  "}}
{"actor":{"display_login":"thedustinsmith"}}