{"action":"created","issue":{"url":"https://api.github.com/repos/getkirby/toolkit/issues/166","repository_url":"https://api.github.com/repos/getkirby/toolkit","labels_url":"https://api.github.com/repos/getkirby/toolkit/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/getkirby/toolkit/issues/166/comments","events_url":"https://api.github.com/repos/getkirby/toolkit/issues/166/events","html_url":"https://github.com/getkirby/toolkit/issues/166","id":155368018,"number":166,"title":"Thumbs for files outside the content folder since 2.3.0","user":{"login":"MathiasGmeiner","id":103595,"avatar_url":"https://avatars.githubusercontent.com/u/103595?v=3","gravatar_id":"","url":"https://api.github.com/users/MathiasGmeiner","html_url":"https://github.com/MathiasGmeiner","followers_url":"https://api.github.com/users/MathiasGmeiner/followers","following_url":"https://api.github.com/users/MathiasGmeiner/following{/other_user}","gists_url":"https://api.github.com/users/MathiasGmeiner/gists{/gist_id}","starred_url":"https://api.github.com/users/MathiasGmeiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MathiasGmeiner/subscriptions","organizations_url":"https://api.github.com/users/MathiasGmeiner/orgs","repos_url":"https://api.github.com/users/MathiasGmeiner/repos","events_url":"https://api.github.com/users/MathiasGmeiner/events{/privacy}","received_events_url":"https://api.github.com/users/MathiasGmeiner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/getkirby/toolkit/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/getkirby/toolkit/milestones/5","html_url":"https://github.com/getkirby/toolkit/milestones/2.3.1","labels_url":"https://api.github.com/repos/getkirby/toolkit/milestones/5/labels","id":1773702,"number":5,"title":"2.3.1","description":null,"creator":{"login":"bastianallgeier","id":24532,"avatar_url":"https://avatars.githubusercontent.com/u/24532?v=3","gravatar_id":"","url":"https://api.github.com/users/bastianallgeier","html_url":"https://github.com/bastianallgeier","followers_url":"https://api.github.com/users/bastianallgeier/followers","following_url":"https://api.github.com/users/bastianallgeier/following{/other_user}","gists_url":"https://api.github.com/users/bastianallgeier/gists{/gist_id}","starred_url":"https://api.github.com/users/bastianallgeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastianallgeier/subscriptions","organizations_url":"https://api.github.com/users/bastianallgeier/orgs","repos_url":"https://api.github.com/users/bastianallgeier/repos","events_url":"https://api.github.com/users/bastianallgeier/events{/privacy}","received_events_url":"https://api.github.com/users/bastianallgeier/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":5,"state":"open","created_at":"2016-05-18T10:37:21Z","updated_at":"2016-07-06T14:47:49Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-05-17T21:36:36Z","updated_at":"2016-07-07T15:08:52Z","closed_at":null,"body":"Before 2.3.0 it was possible to generate the thumbs as described in https://getkirby.com/docs/templates/thumbnails#thumbs-for-files-outside-the-content-folder\r\n\r\nbut after the update to 2.3.0 two things happen:\r\n- default driver is im instead of gd (doesn't matter if gd is in the config.php)\r\n- the root default /thumbs is not correct\r\n\r\nThis is the code I used before 2.3.0:\r\n```\r\n$media = new Media(\r\n  // the absolute path for the file\r\n  kirby()->roots()->index() .'/images/'. $image,         \r\n  // the absolute url\r\n  kirby()->urls()->index() .'/images/'. $image\r\n);\r\n\r\n$image = thumb($media, array('width' => 936, 'height' => 702, 'crop' => true, 'quality' => 40))->url();\r\n```\r\n\r\nand after some debugging this is the working code for 2.3.0:\r\n```\r\n$media = new Media(\r\n  // the absolute path for the file\r\n  kirby()->roots()->index() .'/images/'. $image,         \r\n  // the absolute url\r\n  kirby()->urls()->index() .'/images/'. $image\r\n);\r\n\r\n$image = thumb($media, array('width' => 936, 'height' => 702, 'crop' => true, 'quality' => 40, 'driver' => 'gd', 'root' => $_SERVER['DOCUMENT_ROOT'] .'/thumbs/'));\r\n```"},"comment":{"url":"https://api.github.com/repos/getkirby/toolkit/issues/comments/231107150","html_url":"https://github.com/getkirby/toolkit/issues/166#issuecomment-231107150","issue_url":"https://api.github.com/repos/getkirby/toolkit/issues/166","id":231107150,"user":{"login":"lukasbestle","id":1595007,"avatar_url":"https://avatars.githubusercontent.com/u/1595007?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasbestle","html_url":"https://github.com/lukasbestle","followers_url":"https://api.github.com/users/lukasbestle/followers","following_url":"https://api.github.com/users/lukasbestle/following{/other_user}","gists_url":"https://api.github.com/users/lukasbestle/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasbestle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasbestle/subscriptions","organizations_url":"https://api.github.com/users/lukasbestle/orgs","repos_url":"https://api.github.com/users/lukasbestle/repos","events_url":"https://api.github.com/users/lukasbestle/events{/privacy}","received_events_url":"https://api.github.com/users/lukasbestle/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T15:08:52Z","updated_at":"2016-07-07T15:08:52Z","body":"As far as I can tell, this is the intended behavior since 2.3.0. It makes the Toolkit more independent from the CMS so that it works for users who don't also use the CMS.\r\n\r\nHave you tried using the new `Asset` class?\r\n\r\n```php\r\n$asset = new Asset('images/' . $image);\r\n$image = $asset->thumb(array('width' => 936, 'height' => 702, 'crop' => true, 'quality' => 40))->url();\r\n```\r\n\r\nIf that works without any further changes (as it should), we will instead update the documentation."}}
{"actor":{"display_login":"lukasbestle"}}