{"action":"created","issue":{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/3193","repository_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf","labels_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/3193/labels{/name}","comments_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/3193/comments","events_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/3193/events","html_url":"https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3193","id":187477385,"number":3193,"title":"Error: Could not save image","user":{"login":"bruceburge","id":6773890,"avatar_url":"https://avatars.githubusercontent.com/u/6773890?v=3","gravatar_id":"","url":"https://api.github.com/users/bruceburge","html_url":"https://github.com/bruceburge","followers_url":"https://api.github.com/users/bruceburge/followers","following_url":"https://api.github.com/users/bruceburge/following{/other_user}","gists_url":"https://api.github.com/users/bruceburge/gists{/gist_id}","starred_url":"https://api.github.com/users/bruceburge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruceburge/subscriptions","organizations_url":"https://api.github.com/users/bruceburge/orgs","repos_url":"https://api.github.com/users/bruceburge/repos","events_url":"https://api.github.com/users/bruceburge/events{/privacy}","received_events_url":"https://api.github.com/users/bruceburge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-05T05:08:28Z","updated_at":"2016-11-05T16:22:26Z","closed_at":null,"body":"On windows 10 64bit running the 64 bit version of wkhtmltoimage via an administrator console, using an invalid output extension causes this issue. I've included an example below of several different extensions and their results.\r\n\r\n![image](https://cloud.githubusercontent.com/assets/6773890/20027699/08dbdfe0-a2e9-11e6-928e-e9339ba548fa.png)\r\n\r\nI believe the issue comes from \r\nsrc/lib/imageconverter.cc \r\n```c\r\n// if fmt is empty try to get it from file extension in out\r\n\tif (settings.fmt==\"\") {\r\n\t\tif (settings.out == \"-\")\r\n\t\t\tsettings.fmt = \"jpg\";\r\n\t\telse {\r\n\t\t\tQFileInfo fi(settings.out);\r\n\t\t\tsettings.fmt = fi.suffix();\r\n\t\t}\r\n\t}\r\n```\r\nIn wkhtmltopdf/src/lib/image_c_bindings.cc line 37\r\n\"must be either \"\", \"jpg\", \"png\", \"bmp\" or \"svg\"\"\r\n\r\nI'm guessing if you don't give the format as a commandline argument, it takes it from the outfile extension, if that is invalid, you get this error, "},"comment":{"url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/comments/258622173","html_url":"https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3193#issuecomment-258622173","issue_url":"https://api.github.com/repos/wkhtmltopdf/wkhtmltopdf/issues/3193","id":258622173,"user":{"login":"PhilterPaper","id":13512500,"avatar_url":"https://avatars.githubusercontent.com/u/13512500?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilterPaper","html_url":"https://github.com/PhilterPaper","followers_url":"https://api.github.com/users/PhilterPaper/followers","following_url":"https://api.github.com/users/PhilterPaper/following{/other_user}","gists_url":"https://api.github.com/users/PhilterPaper/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilterPaper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilterPaper/subscriptions","organizations_url":"https://api.github.com/users/PhilterPaper/orgs","repos_url":"https://api.github.com/users/PhilterPaper/repos","events_url":"https://api.github.com/users/PhilterPaper/events{/privacy}","received_events_url":"https://api.github.com/users/PhilterPaper/received_events","type":"User","site_admin":false},"created_at":"2016-11-05T16:22:25Z","updated_at":"2016-11-05T16:22:25Z","body":"So, are you suggesting that screening for invalid extensions (image formats) should be done earlier, at command line processing, and not wait until later in the process? That sounds like an easy enough change to make."}}
{"actor":{"display_login":"PhilterPaper"}}