{"action":"created","issue":{"url":"https://api.github.com/repos/MrRio/jsPDF/issues/762","repository_url":"https://api.github.com/repos/MrRio/jsPDF","labels_url":"https://api.github.com/repos/MrRio/jsPDF/issues/762/labels{/name}","comments_url":"https://api.github.com/repos/MrRio/jsPDF/issues/762/comments","events_url":"https://api.github.com/repos/MrRio/jsPDF/issues/762/events","html_url":"https://github.com/MrRio/jsPDF/issues/762","id":156655554,"number":762,"title":"addImage produces an blur or too low quality image in the pdf","user":{"login":"Balaji-Gopal","id":16814811,"avatar_url":"https://avatars.githubusercontent.com/u/16814811?v=3","gravatar_id":"","url":"https://api.github.com/users/Balaji-Gopal","html_url":"https://github.com/Balaji-Gopal","followers_url":"https://api.github.com/users/Balaji-Gopal/followers","following_url":"https://api.github.com/users/Balaji-Gopal/following{/other_user}","gists_url":"https://api.github.com/users/Balaji-Gopal/gists{/gist_id}","starred_url":"https://api.github.com/users/Balaji-Gopal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Balaji-Gopal/subscriptions","organizations_url":"https://api.github.com/users/Balaji-Gopal/orgs","repos_url":"https://api.github.com/users/Balaji-Gopal/repos","events_url":"https://api.github.com/users/Balaji-Gopal/events{/privacy}","received_events_url":"https://api.github.com/users/Balaji-Gopal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2016-05-25T03:26:15Z","updated_at":"2016-08-30T15:36:01Z","closed_at":null,"body":"I am using the latest version of jsPDF 1.2.61, While adding an image it adds an  blur image even though the image is of high quality, if I the same base64 in on-line decoder it produces the perfect image as the original, but the base64 produces low quality when I use addImage functionality of jsPDF.\r\n\r\nSnippet:\r\n\r\nvar doc = new jsPDF('landscape');\r\nvar Imagebase64=null;\r\ndoc.setFontSize(20);\r\ndoc.text(35, 25, \"GoodYear\");\r\nvar Imagebase64='data:image/jpeg;base64,/<mybase64code>';\r\ndoc.addImage(imagePath, 'jpeg',0, 5, 210, 35);\r\ndoc.save(\"mypdf.pdf\");\r\n"},"comment":{"url":"https://api.github.com/repos/MrRio/jsPDF/issues/comments/243481413","html_url":"https://github.com/MrRio/jsPDF/issues/762#issuecomment-243481413","issue_url":"https://api.github.com/repos/MrRio/jsPDF/issues/762","id":243481413,"user":{"login":"jalgithub","id":21337455,"avatar_url":"https://avatars.githubusercontent.com/u/21337455?v=3","gravatar_id":"","url":"https://api.github.com/users/jalgithub","html_url":"https://github.com/jalgithub","followers_url":"https://api.github.com/users/jalgithub/followers","following_url":"https://api.github.com/users/jalgithub/following{/other_user}","gists_url":"https://api.github.com/users/jalgithub/gists{/gist_id}","starred_url":"https://api.github.com/users/jalgithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jalgithub/subscriptions","organizations_url":"https://api.github.com/users/jalgithub/orgs","repos_url":"https://api.github.com/users/jalgithub/repos","events_url":"https://api.github.com/users/jalgithub/events{/privacy}","received_events_url":"https://api.github.com/users/jalgithub/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T15:36:01Z","updated_at":"2016-08-30T15:36:01Z","body":"I debugged versions 1 and 2 side by side, and came to the conclusion that this is caused by an undocumented change to the jsPDFAPI.arrayBufferToBinaryString function (line 4267 in the jspdf.debug.js). In this function, the following lines have been added:\r\n`\t\tif('TextDecoder' in window){\r\n\t\t\tvar decoder = new TextDecoder('ascii');\r\n\t\t\treturn decoder.decode(buffer);\r\n\t\t}`\r\nCommenting these out and the correct way of rendering the PNG is restored. I'm not sure why it's in there, or why it causes this problem, but at least there's a workaround."}}
{"actor":{"display_login":"jalgithub"}}