{"action":"created","comment":{"url":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/comments/78835693","id":78835693,"diff_hunk":"@@ -63,17 +70,100 @@ public function connect(Application $app)\n      */\n     public function thumbnail(Application $app, Request $request, $file, $action, $width, $height)\n     {\n+        // Set to default 404 image if restricted to aliases\n+        if($this->isRestricted($app, $request)) {\n+            $transaction = $this->defaultTransaction($app, $request);\n+            $thumbnail = $app['thumbnails']->respond($transaction);\n+            return new Response($thumbnail);\n+        }\n+\n+        return $this->serve($app, $request, $file, $action, $width, $height);\n+    }\n+\n+    /**\n+     * Returns a thumbnail response.\n+     *\n+     * @param Application $app\n+     * @param Request     $request\n+     * @param string      $file\n+     * @param string      $alias\n+     *\n+     * @return Response\n+     */\n+    public function alias(Application $app, Request $request, $file, $alias)\n+    {\n+        $config = $app[\"config\"]->get(\"theme/image_aliases/\".$alias, false);\n+\n+        // Set to default 404 image if alias does not exist\n+        if(!$config) {\n+            $transaction = $this->defaultTransaction($app, $request);\n+            $thumbnail = $app['thumbnails']->respond($transaction);\n+            return new Response($thumbnail);\n+        }\n+\n+        $width  = isset($config[\"size\"][0])  ? $config[\"size\"][0]  : 0;\n+        $height = isset($config[\"size\"][1])  ? $config[\"size\"][1]  : 0;\n+        $action = isset($config[\"cropping\"]) ? $config[\"cropping\"] : Action::CROP;","path":"src/Controller.php","position":58,"original_position":58,"commit_id":"2e4852cbd54dff7984741c0df39a49ee3958d3ad","original_commit_id":"2e4852cbd54dff7984741c0df39a49ee3958d3ad","user":{"login":"ToBe998","id":12497310,"avatar_url":"https://avatars.githubusercontent.com/u/12497310?v=3","gravatar_id":"","url":"https://api.github.com/users/ToBe998","html_url":"https://github.com/ToBe998","followers_url":"https://api.github.com/users/ToBe998/followers","following_url":"https://api.github.com/users/ToBe998/following{/other_user}","gists_url":"https://api.github.com/users/ToBe998/gists{/gist_id}","starred_url":"https://api.github.com/users/ToBe998/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToBe998/subscriptions","organizations_url":"https://api.github.com/users/ToBe998/orgs","repos_url":"https://api.github.com/users/ToBe998/repos","events_url":"https://api.github.com/users/ToBe998/events{/privacy}","received_events_url":"https://api.github.com/users/ToBe998/received_events","type":"User","site_admin":false},"body":"Need to check tomorrow. But like i said, i can change it anyways.","created_at":"2016-09-14T20:41:36Z","updated_at":"2016-09-14T20:41:36Z","html_url":"https://github.com/bolt/bolt-thumbs/pull/29#discussion_r78835693","pull_request_url":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/comments/78835693"},"html":{"href":"https://github.com/bolt/bolt-thumbs/pull/29#discussion_r78835693"},"pull_request":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29","id":85233183,"html_url":"https://github.com/bolt/bolt-thumbs/pull/29","diff_url":"https://github.com/bolt/bolt-thumbs/pull/29.diff","patch_url":"https://github.com/bolt/bolt-thumbs/pull/29.patch","issue_url":"https://api.github.com/repos/bolt/bolt-thumbs/issues/29","number":29,"state":"open","locked":false,"title":"image aliases added #3703","user":{"login":"ToBe998","id":12497310,"avatar_url":"https://avatars.githubusercontent.com/u/12497310?v=3","gravatar_id":"","url":"https://api.github.com/users/ToBe998","html_url":"https://github.com/ToBe998","followers_url":"https://api.github.com/users/ToBe998/followers","following_url":"https://api.github.com/users/ToBe998/following{/other_user}","gists_url":"https://api.github.com/users/ToBe998/gists{/gist_id}","starred_url":"https://api.github.com/users/ToBe998/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ToBe998/subscriptions","organizations_url":"https://api.github.com/users/ToBe998/orgs","repos_url":"https://api.github.com/users/ToBe998/repos","events_url":"https://api.github.com/users/ToBe998/events{/privacy}","received_events_url":"https://api.github.com/users/ToBe998/received_events","type":"User","site_admin":false},"body":"This is a first try of doing it as much as the current code base does it while not changing to much of it. Feel free to suggest changes...\r\n\r\nThere will be a complimenting bolt/bolt PR with the new config values and a sample alias inside the theme.yml\r\nThe sample theme.yml will look like this:\r\n\r\n```\r\n# Aliases can be set to restrict images to a specific set of available\r\n# resolutions or to decouple image sizes from template files.\r\nimage_aliases:\r\n    myimageformat:\r\n        size: [400,300]\r\n        cropping: crop\r\n```\r\n\r\n**Note** The twig filters for image and thumbnail are not done yet. They are probably inside bolt and not bolt-thumbs. Will add them asap!","created_at":"2016-09-14T14:01:12Z","updated_at":"2016-09-14T20:41:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7196be5ac28322f1cccf5449ad0df04f57e6121","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29/commits","review_comments_url":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29/comments","review_comment_url":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bolt/bolt-thumbs/issues/29/comments","statuses_url":"https://api.github.com/repos/bolt/bolt-thumbs/statuses/2e4852cbd54dff7984741c0df39a49ee3958d3ad","head":{"label":"CondeNastDigital:master","ref":"master","sha":"2e4852cbd54dff7984741c0df39a49ee3958d3ad","user":{"login":"CondeNastDigital","id":337775,"avatar_url":"https://avatars.githubusercontent.com/u/337775?v=3","gravatar_id":"","url":"https://api.github.com/users/CondeNastDigital","html_url":"https://github.com/CondeNastDigital","followers_url":"https://api.github.com/users/CondeNastDigital/followers","following_url":"https://api.github.com/users/CondeNastDigital/following{/other_user}","gists_url":"https://api.github.com/users/CondeNastDigital/gists{/gist_id}","starred_url":"https://api.github.com/users/CondeNastDigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CondeNastDigital/subscriptions","organizations_url":"https://api.github.com/users/CondeNastDigital/orgs","repos_url":"https://api.github.com/users/CondeNastDigital/repos","events_url":"https://api.github.com/users/CondeNastDigital/events{/privacy}","received_events_url":"https://api.github.com/users/CondeNastDigital/received_events","type":"Organization","site_admin":false},"repo":{"id":68210201,"name":"bolt-thumbs","full_name":"CondeNastDigital/bolt-thumbs","owner":{"login":"CondeNastDigital","id":337775,"avatar_url":"https://avatars.githubusercontent.com/u/337775?v=3","gravatar_id":"","url":"https://api.github.com/users/CondeNastDigital","html_url":"https://github.com/CondeNastDigital","followers_url":"https://api.github.com/users/CondeNastDigital/followers","following_url":"https://api.github.com/users/CondeNastDigital/following{/other_user}","gists_url":"https://api.github.com/users/CondeNastDigital/gists{/gist_id}","starred_url":"https://api.github.com/users/CondeNastDigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CondeNastDigital/subscriptions","organizations_url":"https://api.github.com/users/CondeNastDigital/orgs","repos_url":"https://api.github.com/users/CondeNastDigital/repos","events_url":"https://api.github.com/users/CondeNastDigital/events{/privacy}","received_events_url":"https://api.github.com/users/CondeNastDigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CondeNastDigital/bolt-thumbs","description":"Thumbnail handler for Bolt Images","fork":true,"url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs","forks_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/forks","keys_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/teams","hooks_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/hooks","issue_events_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/issues/events{/number}","events_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/events","assignees_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/assignees{/user}","branches_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/branches{/branch}","tags_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/tags","blobs_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/git/refs{/sha}","trees_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/statuses/{sha}","languages_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/languages","stargazers_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/stargazers","contributors_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/contributors","subscribers_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/subscribers","subscription_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/subscription","commits_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/commits{/sha}","git_commits_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/git/commits{/sha}","comments_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/comments{/number}","issue_comment_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/issues/comments{/number}","contents_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/contents/{+path}","compare_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/merges","archive_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/downloads","issues_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/issues{/number}","pulls_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/pulls{/number}","milestones_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/milestones{/number}","notifications_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/labels{/name}","releases_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/releases{/id}","deployments_url":"https://api.github.com/repos/CondeNastDigital/bolt-thumbs/deployments","created_at":"2016-09-14T13:48:27Z","updated_at":"2016-09-14T13:48:28Z","pushed_at":"2016-09-14T13:56:30Z","git_url":"git://github.com/CondeNastDigital/bolt-thumbs.git","ssh_url":"git@github.com:CondeNastDigital/bolt-thumbs.git","clone_url":"https://github.com/CondeNastDigital/bolt-thumbs.git","svn_url":"https://github.com/CondeNastDigital/bolt-thumbs","homepage":"","size":692,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bolt:master","ref":"master","sha":"2057c87db3c5df8339f78b9ccf8145e25df8de05","user":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"repo":{"id":20107793,"name":"bolt-thumbs","full_name":"bolt/bolt-thumbs","owner":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bolt/bolt-thumbs","description":"Thumbnail handler for Bolt Images","fork":false,"url":"https://api.github.com/repos/bolt/bolt-thumbs","forks_url":"https://api.github.com/repos/bolt/bolt-thumbs/forks","keys_url":"https://api.github.com/repos/bolt/bolt-thumbs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bolt/bolt-thumbs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bolt/bolt-thumbs/teams","hooks_url":"https://api.github.com/repos/bolt/bolt-thumbs/hooks","issue_events_url":"https://api.github.com/repos/bolt/bolt-thumbs/issues/events{/number}","events_url":"https://api.github.com/repos/bolt/bolt-thumbs/events","assignees_url":"https://api.github.com/repos/bolt/bolt-thumbs/assignees{/user}","branches_url":"https://api.github.com/repos/bolt/bolt-thumbs/branches{/branch}","tags_url":"https://api.github.com/repos/bolt/bolt-thumbs/tags","blobs_url":"https://api.github.com/repos/bolt/bolt-thumbs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bolt/bolt-thumbs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bolt/bolt-thumbs/git/refs{/sha}","trees_url":"https://api.github.com/repos/bolt/bolt-thumbs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bolt/bolt-thumbs/statuses/{sha}","languages_url":"https://api.github.com/repos/bolt/bolt-thumbs/languages","stargazers_url":"https://api.github.com/repos/bolt/bolt-thumbs/stargazers","contributors_url":"https://api.github.com/repos/bolt/bolt-thumbs/contributors","subscribers_url":"https://api.github.com/repos/bolt/bolt-thumbs/subscribers","subscription_url":"https://api.github.com/repos/bolt/bolt-thumbs/subscription","commits_url":"https://api.github.com/repos/bolt/bolt-thumbs/commits{/sha}","git_commits_url":"https://api.github.com/repos/bolt/bolt-thumbs/git/commits{/sha}","comments_url":"https://api.github.com/repos/bolt/bolt-thumbs/comments{/number}","issue_comment_url":"https://api.github.com/repos/bolt/bolt-thumbs/issues/comments{/number}","contents_url":"https://api.github.com/repos/bolt/bolt-thumbs/contents/{+path}","compare_url":"https://api.github.com/repos/bolt/bolt-thumbs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bolt/bolt-thumbs/merges","archive_url":"https://api.github.com/repos/bolt/bolt-thumbs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bolt/bolt-thumbs/downloads","issues_url":"https://api.github.com/repos/bolt/bolt-thumbs/issues{/number}","pulls_url":"https://api.github.com/repos/bolt/bolt-thumbs/pulls{/number}","milestones_url":"https://api.github.com/repos/bolt/bolt-thumbs/milestones{/number}","notifications_url":"https://api.github.com/repos/bolt/bolt-thumbs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bolt/bolt-thumbs/labels{/name}","releases_url":"https://api.github.com/repos/bolt/bolt-thumbs/releases{/id}","deployments_url":"https://api.github.com/repos/bolt/bolt-thumbs/deployments","created_at":"2014-05-23T17:18:50Z","updated_at":"2016-01-19T06:05:24Z","pushed_at":"2016-09-14T14:01:12Z","git_url":"git://github.com/bolt/bolt-thumbs.git","ssh_url":"git@github.com:bolt/bolt-thumbs.git","clone_url":"https://github.com/bolt/bolt-thumbs.git","svn_url":"https://github.com/bolt/bolt-thumbs","homepage":"","size":693,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":6,"forks":13,"open_issues":6,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29"},"html":{"href":"https://github.com/bolt/bolt-thumbs/pull/29"},"issue":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/issues/29"},"comments":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/bolt/bolt-thumbs/statuses/2e4852cbd54dff7984741c0df39a49ee3958d3ad"}}}}
{"actor":{"display_login":"ToBe998"}}