{"action":"created","issue":{"url":"https://api.github.com/repos/tcr/scissors/issues/17","repository_url":"https://api.github.com/repos/tcr/scissors","labels_url":"https://api.github.com/repos/tcr/scissors/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/tcr/scissors/issues/17/comments","events_url":"https://api.github.com/repos/tcr/scissors/issues/17/events","html_url":"https://github.com/tcr/scissors/pull/17","id":228797612,"number":17,"title":"Features/simple rasterizer","user":{"login":"joe1chen","id":48643,"avatar_url":"https://avatars0.githubusercontent.com/u/48643?v=3","gravatar_id":"","url":"https://api.github.com/users/joe1chen","html_url":"https://github.com/joe1chen","followers_url":"https://api.github.com/users/joe1chen/followers","following_url":"https://api.github.com/users/joe1chen/following{/other_user}","gists_url":"https://api.github.com/users/joe1chen/gists{/gist_id}","starred_url":"https://api.github.com/users/joe1chen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joe1chen/subscriptions","organizations_url":"https://api.github.com/users/joe1chen/orgs","repos_url":"https://api.github.com/users/joe1chen/repos","events_url":"https://api.github.com/users/joe1chen/events{/privacy}","received_events_url":"https://api.github.com/users/joe1chen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-05-15T18:09:02Z","updated_at":"2017-05-15T19:41:53Z","closed_at":"2017-05-15T18:15:13Z","pull_request":{"url":"https://api.github.com/repos/tcr/scissors/pulls/17","html_url":"https://github.com/tcr/scissors/pull/17","diff_url":"https://github.com/tcr/scissors/pull/17.diff","patch_url":"https://github.com/tcr/scissors/pull/17.patch"},"body":"Add more generic imageStream function which allows you to\r\n1) Pass in page number and format for output\r\n2) Add option to use simple rasterizer that skips temp file creation and bounding box code.\r\n3) Add option to use the crop box for generating images from PDF.  This results in the most accurate resulting image.\r\n\r\nI opted to leave the original rasterizer method as is for backwards compatability. \r\n\r\nThe original rasterizer has several limitations. It uses this funky bounding box code to crop the resulting image.  Not only is this super slow, but it is not a good representation of the original page from the PDF.  See samples below.\r\n\r\nAdded new mocha tests:\r\n```\r\nmocha -t 7000\r\n\r\n  Scissors\r\n    #range()\r\n      1) should extract a range of pdf pages (using a stream)\r\n    #range()\r\n      2) should extract a range of pdf pages (using a promise)\r\n    #jpgStream()\r\nrasterize.js: opening temp file\r\nrasterize.js: closing temp file /var/folders/c7/qj7gqpcj06jbb1hkprks5ny80000gn/T/scissors117415-10822-cq8m6v.xt61kh85mi\r\nrasterize.js: closed.\r\nrasterize.js: [ 69, 30, 527, 769 ]\r\nrasterize.js: ended\r\nrasterize.js: Finished writing image.\r\n      ✓ should extract a single jpg page (using default rasterize) (5965ms)\r\n    #pngStream()\r\nrasterize.js: opening temp file\r\nrasterize.js: closing temp file /var/folders/c7/qj7gqpcj06jbb1hkprks5ny80000gn/T/scissors117415-10827-yyne5m.4o2loc4n29\r\nrasterize.js: closed.\r\nrasterize.js: [ 69, 30, 527, 769 ]\r\nrasterize.js: ended\r\nrasterize.js: Finished writing image.\r\n      ✓ should extract a single png page (using default rasterize) (6073ms)\r\n    #jpgStream()\r\nsimple_rasterize.js: Finished writing image.\r\n      ✓ should extract a single jpg page (using simple rasterize) (622ms)\r\n    #pngStream()\r\nsimple_rasterize.js: Finished writing image.\r\n      ✓ should extract a single png page (using simple rasterize) (891ms)\r\n    #jpgStream()\r\nsimple_rasterize.js: Finished writing image.\r\n      ✓ should extract a single jpg page using crop box (using simple rasterize) (619ms)\r\n    #pngStream()\r\nsimple_rasterize.js: Finished writing image.\r\n      ✓ should extract a single png page using crop box (using simple rasterize) (876ms)\r\n```\r\n\r\nOutput:\r\n\r\nOriginal Rasterizer:\r\n![_page1_default](https://cloud.githubusercontent.com/assets/48643/26071941/b7d5ff74-395e-11e7-8979-2ae8d86fc9cb.jpg)\r\n![_page1_default](https://cloud.githubusercontent.com/assets/48643/26071942/b7d62ce2-395e-11e7-98c7-0c56ac2432f4.png)\r\n\r\nNew simple rasterizer with crop box\r\n![_page1_simple_crop_box](https://cloud.githubusercontent.com/assets/48643/26071943/b7d7bb52-395e-11e7-9079-541f70e7a643.jpg)\r\n![_page1_simple_crop_box](https://cloud.githubusercontent.com/assets/48643/26071944/b7d882d0-395e-11e7-818b-aa1ee99d34c4.png)\r\n\r\nNew simple rasterizer without crop box\r\n![_page1_simple](https://cloud.githubusercontent.com/assets/48643/26071940/b7d5b0e6-395e-11e7-8460-3c722537576c.jpg)\r\n![_page1_simple](https://cloud.githubusercontent.com/assets/48643/26071945/b7db4b8c-395e-11e7-91ae-d71fa9f5f7a6.png)\r\n"},"comment":{"url":"https://api.github.com/repos/tcr/scissors/issues/comments/301582056","html_url":"https://github.com/tcr/scissors/pull/17#issuecomment-301582056","issue_url":"https://api.github.com/repos/tcr/scissors/issues/17","id":301582056,"user":{"login":"cboulanger","id":75390,"avatar_url":"https://avatars1.githubusercontent.com/u/75390?v=3","gravatar_id":"","url":"https://api.github.com/users/cboulanger","html_url":"https://github.com/cboulanger","followers_url":"https://api.github.com/users/cboulanger/followers","following_url":"https://api.github.com/users/cboulanger/following{/other_user}","gists_url":"https://api.github.com/users/cboulanger/gists{/gist_id}","starred_url":"https://api.github.com/users/cboulanger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cboulanger/subscriptions","organizations_url":"https://api.github.com/users/cboulanger/orgs","repos_url":"https://api.github.com/users/cboulanger/repos","events_url":"https://api.github.com/users/cboulanger/events{/privacy}","received_events_url":"https://api.github.com/users/cboulanger/received_events","type":"User","site_admin":false},"created_at":"2017-05-15T19:41:53Z","updated_at":"2017-05-15T19:41:53Z","body":"@rikkertkoppes Thank you. It would be super helpful if you could create a pull request that only contains the following two commits \r\n- Added encryption (14b4b20)\r\n- extracted PDFTKCMD constant (552fe85) \r\nBut if that is too much trouble, do not bother, then I will cherry-pick the commits, I need to learn how to do that anyways."}}
{"actor":{"display_login":"cboulanger"}}