{"action":"created","comment":{"url":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/comments/43153803","id":43153803,"diff_hunk":"@@ -0,0 +1,94 @@\n+Basic Usage\n+===========\n+\n+This bundle works by configuring a set of filters and then applying those\n+filters to images inside a template So, start by creating some sort of filter\n+that you need to apply somewhere in your application. For example, suppose\n+you want to thumbnail an image to a size of 120x90 pixels:\n+\n+.. code-block:: yaml\n+\n+    # app/config/config.yml\n+\n+    liip_imagine:\n+        resolvers:\n+           default:\n+              web_path: ~\n+\n+        filter_sets:\n+            cache: ~\n+            my_thumb:\n+                quality: 75\n+                filters:\n+                    thumbnail: { size: [120, 90], mode: outbound }\n+\n+You've now defined a filter set called `my_thumb` that performs a thumbnail transformation.\n+We'll learn more about available transformations later, but for now, this\n+new filter can be used immediately in a template:\n+\n+.. code-block:: jinja\n+\n+    <img src=\"{{ '/relative/path/to/image.jpg' | imagine_filter('my_thumb') }}\" />\n+\n+Or if you're using PHP templates:\n+\n+.. code-block:: php\n+    \n+    <img src=\"<?php $this['imagine']->filter('/relative/path/to/image.jpg', 'my_thumb') ?>\" />\n+\n+Behind the scenes, the bundles applies the filter(s) to the image on the first\n+request and then caches the image to a similar path. On the next request,\n+the cached image would be served directly from the file system.\n+\n+In this example, the final rendered path would be something like\n+`/media/cache/my_thumb/relative/path/to/image.jpg`. This is where Imagine\n+would save the filtered image file.\n+\n+You can also pass some options at runtime:\n+\n+.. code-block:: jinja\n+\n+    {% set runtimeConfig = {\"thumbnail\": {\"size\": [50, 50] }} %}\n+    <img src=\"{{ '/relative/path/to/image.jpg' | imagine_filter('my_thumb', runtimeConfig) }}\" />\n+\n+Or if you're using PHP templates:\n+\n+.. code-block:: php\n+\n+    <?php\n+    $runtimeConfig = array(\n+        \"thumbnail\" => array(\n+            \"size\" => array(50, 50)\n+        )\n+    );\n+    ?>\n+\n+    <img src=\"<?php $this['imagine']->filter('/relative/path/to/image.jpg', 'my_thumb', $runtimeConfig) ?>\" />\n+\n+Also you can resolve image url from console:\n+\n+.. code-block:: jinja\n+\n+    app/console liip:imagine:cache:resolve relative/path/to/image.jpg relative/path/to/image2.jpg --filters=my_thumb --filters=thumbnail_default\n+\n+Where only paths required parameter. They are separated by space. If you omit filters option will be applied all available filters.\n+\n+If you need to access filtered image URL in your controller:\n+\n+.. code-block:: php\n+    \n+    $this->get('liip_imagine.cache.manager')->getBrowserPath('/relative/path/to/image.jpg', 'my_thumb', true),\n+\n+In this case, the final rendered path would contain some random data in the path\n+`/media/cache/my_thumb/S8rrlhhQ/relative/path/to/image.jpg`. This is where Imagine\n+would save the filtered image file.\n+\n+.. note::\n+    Using the ``dev`` environment you might find that the images are not properly rendered when\n+    using the template helper. This is likely caused by having ``intercept_redirect`` enabled in your\n+    application configuration. To ensure that the images are rendered disable this option:\n+\n+    .. code-block:: jinja","path":"Resources/doc/basic-usage.rst","position":91,"original_position":91,"commit_id":"c0afc4bb055f11fdd9269d2b4fc4b1dc31596e86","original_commit_id":"c0afc4bb055f11fdd9269d2b4fc4b1dc31596e86","user":{"login":"lsmith77","id":300279,"avatar_url":"https://avatars.githubusercontent.com/u/300279?v=3","gravatar_id":"","url":"https://api.github.com/users/lsmith77","html_url":"https://github.com/lsmith77","followers_url":"https://api.github.com/users/lsmith77/followers","following_url":"https://api.github.com/users/lsmith77/following{/other_user}","gists_url":"https://api.github.com/users/lsmith77/gists{/gist_id}","starred_url":"https://api.github.com/users/lsmith77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsmith77/subscriptions","organizations_url":"https://api.github.com/users/lsmith77/orgs","repos_url":"https://api.github.com/users/lsmith77/repos","events_url":"https://api.github.com/users/lsmith77/events{/privacy}","received_events_url":"https://api.github.com/users/lsmith77/received_events","type":"User","site_admin":false},"body":"yeah .. not sure if one can nest like this ..\r\n\r\n@WouterJ ?","created_at":"2015-10-27T17:16:25Z","updated_at":"2015-10-27T17:16:25Z","html_url":"https://github.com/liip/LiipImagineBundle/pull/651#discussion_r43153803","pull_request_url":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651","_links":{"self":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/comments/43153803"},"html":{"href":"https://github.com/liip/LiipImagineBundle/pull/651#discussion_r43153803"},"pull_request":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651"}}},"pull_request":{"url":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651","id":48734454,"html_url":"https://github.com/liip/LiipImagineBundle/pull/651","diff_url":"https://github.com/liip/LiipImagineBundle/pull/651.diff","patch_url":"https://github.com/liip/LiipImagineBundle/pull/651.patch","issue_url":"https://api.github.com/repos/liip/LiipImagineBundle/issues/651","number":651,"state":"open","locked":false,"title":"Add notes on basic usage","user":{"login":"kix","id":345754,"avatar_url":"https://avatars.githubusercontent.com/u/345754?v=3","gravatar_id":"","url":"https://api.github.com/users/kix","html_url":"https://github.com/kix","followers_url":"https://api.github.com/users/kix/followers","following_url":"https://api.github.com/users/kix/following{/other_user}","gists_url":"https://api.github.com/users/kix/gists{/gist_id}","starred_url":"https://api.github.com/users/kix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kix/subscriptions","organizations_url":"https://api.github.com/users/kix/orgs","repos_url":"https://api.github.com/users/kix/repos","events_url":"https://api.github.com/users/kix/events{/privacy}","received_events_url":"https://api.github.com/users/kix/received_events","type":"User","site_admin":false},"body":"Turns out the [doc on Symfony website](http://symfony.com/doc/master/bundles/LiipImagineBundle/index.html) (which is generated from the RSTs in `Resources/doc`) lacks a description of basic bundle functionality usage. The `Introduction` section only describes the bundle's inner implementation, and other sections don't mention real bundle usage at all. Turns out the documentation for that was present in `README.md`, so I've basically converted it from Markdown to RST.\r\n\r\nThis fix should avoid confusion among the users that read the bundle's documentation on Symfony website.","created_at":"2015-10-26T12:45:39Z","updated_at":"2015-10-27T17:16:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31fed834ca4890900a48810825ab33e45603bd99","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651/commits","review_comments_url":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651/comments","review_comment_url":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/liip/LiipImagineBundle/issues/651/comments","statuses_url":"https://api.github.com/repos/liip/LiipImagineBundle/statuses/c0afc4bb055f11fdd9269d2b4fc4b1dc31596e86","head":{"label":"kix:add-basic-doc","ref":"add-basic-doc","sha":"c0afc4bb055f11fdd9269d2b4fc4b1dc31596e86","user":{"login":"kix","id":345754,"avatar_url":"https://avatars.githubusercontent.com/u/345754?v=3","gravatar_id":"","url":"https://api.github.com/users/kix","html_url":"https://github.com/kix","followers_url":"https://api.github.com/users/kix/followers","following_url":"https://api.github.com/users/kix/following{/other_user}","gists_url":"https://api.github.com/users/kix/gists{/gist_id}","starred_url":"https://api.github.com/users/kix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kix/subscriptions","organizations_url":"https://api.github.com/users/kix/orgs","repos_url":"https://api.github.com/users/kix/repos","events_url":"https://api.github.com/users/kix/events{/privacy}","received_events_url":"https://api.github.com/users/kix/received_events","type":"User","site_admin":false},"repo":{"id":44957844,"name":"LiipImagineBundle","full_name":"kix/LiipImagineBundle","owner":{"login":"kix","id":345754,"avatar_url":"https://avatars.githubusercontent.com/u/345754?v=3","gravatar_id":"","url":"https://api.github.com/users/kix","html_url":"https://github.com/kix","followers_url":"https://api.github.com/users/kix/followers","following_url":"https://api.github.com/users/kix/following{/other_user}","gists_url":"https://api.github.com/users/kix/gists{/gist_id}","starred_url":"https://api.github.com/users/kix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kix/subscriptions","organizations_url":"https://api.github.com/users/kix/orgs","repos_url":"https://api.github.com/users/kix/repos","events_url":"https://api.github.com/users/kix/events{/privacy}","received_events_url":"https://api.github.com/users/kix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kix/LiipImagineBundle","description":"Symfony2 Bundle to assist in imagine manipulation using the imagine library","fork":true,"url":"https://api.github.com/repos/kix/LiipImagineBundle","forks_url":"https://api.github.com/repos/kix/LiipImagineBundle/forks","keys_url":"https://api.github.com/repos/kix/LiipImagineBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kix/LiipImagineBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kix/LiipImagineBundle/teams","hooks_url":"https://api.github.com/repos/kix/LiipImagineBundle/hooks","issue_events_url":"https://api.github.com/repos/kix/LiipImagineBundle/issues/events{/number}","events_url":"https://api.github.com/repos/kix/LiipImagineBundle/events","assignees_url":"https://api.github.com/repos/kix/LiipImagineBundle/assignees{/user}","branches_url":"https://api.github.com/repos/kix/LiipImagineBundle/branches{/branch}","tags_url":"https://api.github.com/repos/kix/LiipImagineBundle/tags","blobs_url":"https://api.github.com/repos/kix/LiipImagineBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kix/LiipImagineBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kix/LiipImagineBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/kix/LiipImagineBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kix/LiipImagineBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/kix/LiipImagineBundle/languages","stargazers_url":"https://api.github.com/repos/kix/LiipImagineBundle/stargazers","contributors_url":"https://api.github.com/repos/kix/LiipImagineBundle/contributors","subscribers_url":"https://api.github.com/repos/kix/LiipImagineBundle/subscribers","subscription_url":"https://api.github.com/repos/kix/LiipImagineBundle/subscription","commits_url":"https://api.github.com/repos/kix/LiipImagineBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/kix/LiipImagineBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/kix/LiipImagineBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/kix/LiipImagineBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/kix/LiipImagineBundle/contents/{+path}","compare_url":"https://api.github.com/repos/kix/LiipImagineBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kix/LiipImagineBundle/merges","archive_url":"https://api.github.com/repos/kix/LiipImagineBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kix/LiipImagineBundle/downloads","issues_url":"https://api.github.com/repos/kix/LiipImagineBundle/issues{/number}","pulls_url":"https://api.github.com/repos/kix/LiipImagineBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/kix/LiipImagineBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/kix/LiipImagineBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kix/LiipImagineBundle/labels{/name}","releases_url":"https://api.github.com/repos/kix/LiipImagineBundle/releases{/id}","created_at":"2015-10-26T09:18:33Z","updated_at":"2015-10-26T09:18:34Z","pushed_at":"2015-10-26T12:37:06Z","git_url":"git://github.com/kix/LiipImagineBundle.git","ssh_url":"git@github.com:kix/LiipImagineBundle.git","clone_url":"https://github.com/kix/LiipImagineBundle.git","svn_url":"https://github.com/kix/LiipImagineBundle","homepage":"http://liip.ch","size":8503,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"liip:master","ref":"master","sha":"3810d25f99b2139aad8cc411a516e97305459b0f","user":{"login":"liip","id":166102,"avatar_url":"https://avatars.githubusercontent.com/u/166102?v=3","gravatar_id":"","url":"https://api.github.com/users/liip","html_url":"https://github.com/liip","followers_url":"https://api.github.com/users/liip/followers","following_url":"https://api.github.com/users/liip/following{/other_user}","gists_url":"https://api.github.com/users/liip/gists{/gist_id}","starred_url":"https://api.github.com/users/liip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liip/subscriptions","organizations_url":"https://api.github.com/users/liip/orgs","repos_url":"https://api.github.com/users/liip/repos","events_url":"https://api.github.com/users/liip/events{/privacy}","received_events_url":"https://api.github.com/users/liip/received_events","type":"Organization","site_admin":false},"repo":{"id":2515323,"name":"LiipImagineBundle","full_name":"liip/LiipImagineBundle","owner":{"login":"liip","id":166102,"avatar_url":"https://avatars.githubusercontent.com/u/166102?v=3","gravatar_id":"","url":"https://api.github.com/users/liip","html_url":"https://github.com/liip","followers_url":"https://api.github.com/users/liip/followers","following_url":"https://api.github.com/users/liip/following{/other_user}","gists_url":"https://api.github.com/users/liip/gists{/gist_id}","starred_url":"https://api.github.com/users/liip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liip/subscriptions","organizations_url":"https://api.github.com/users/liip/orgs","repos_url":"https://api.github.com/users/liip/repos","events_url":"https://api.github.com/users/liip/events{/privacy}","received_events_url":"https://api.github.com/users/liip/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/liip/LiipImagineBundle","description":"Symfony2 Bundle to assist in imagine manipulation using the imagine library","fork":false,"url":"https://api.github.com/repos/liip/LiipImagineBundle","forks_url":"https://api.github.com/repos/liip/LiipImagineBundle/forks","keys_url":"https://api.github.com/repos/liip/LiipImagineBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liip/LiipImagineBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liip/LiipImagineBundle/teams","hooks_url":"https://api.github.com/repos/liip/LiipImagineBundle/hooks","issue_events_url":"https://api.github.com/repos/liip/LiipImagineBundle/issues/events{/number}","events_url":"https://api.github.com/repos/liip/LiipImagineBundle/events","assignees_url":"https://api.github.com/repos/liip/LiipImagineBundle/assignees{/user}","branches_url":"https://api.github.com/repos/liip/LiipImagineBundle/branches{/branch}","tags_url":"https://api.github.com/repos/liip/LiipImagineBundle/tags","blobs_url":"https://api.github.com/repos/liip/LiipImagineBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liip/LiipImagineBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liip/LiipImagineBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/liip/LiipImagineBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liip/LiipImagineBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/liip/LiipImagineBundle/languages","stargazers_url":"https://api.github.com/repos/liip/LiipImagineBundle/stargazers","contributors_url":"https://api.github.com/repos/liip/LiipImagineBundle/contributors","subscribers_url":"https://api.github.com/repos/liip/LiipImagineBundle/subscribers","subscription_url":"https://api.github.com/repos/liip/LiipImagineBundle/subscription","commits_url":"https://api.github.com/repos/liip/LiipImagineBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/liip/LiipImagineBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/liip/LiipImagineBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/liip/LiipImagineBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/liip/LiipImagineBundle/contents/{+path}","compare_url":"https://api.github.com/repos/liip/LiipImagineBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liip/LiipImagineBundle/merges","archive_url":"https://api.github.com/repos/liip/LiipImagineBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liip/LiipImagineBundle/downloads","issues_url":"https://api.github.com/repos/liip/LiipImagineBundle/issues{/number}","pulls_url":"https://api.github.com/repos/liip/LiipImagineBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/liip/LiipImagineBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/liip/LiipImagineBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liip/LiipImagineBundle/labels{/name}","releases_url":"https://api.github.com/repos/liip/LiipImagineBundle/releases{/id}","created_at":"2011-10-04T22:41:15Z","updated_at":"2015-10-27T07:16:31Z","pushed_at":"2015-10-26T12:45:40Z","git_url":"git://github.com/liip/LiipImagineBundle.git","ssh_url":"git@github.com:liip/LiipImagineBundle.git","clone_url":"https://github.com/liip/LiipImagineBundle.git","svn_url":"https://github.com/liip/LiipImagineBundle","homepage":"http://liip.ch","size":8503,"stargazers_count":508,"watchers_count":508,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":69,"forks":199,"open_issues":69,"watchers":508,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651"},"html":{"href":"https://github.com/liip/LiipImagineBundle/pull/651"},"issue":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/issues/651"},"comments":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/issues/651/comments"},"review_comments":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651/comments"},"review_comment":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/pulls/651/commits"},"statuses":{"href":"https://api.github.com/repos/liip/LiipImagineBundle/statuses/c0afc4bb055f11fdd9269d2b4fc4b1dc31596e86"}}}}