{"action":"closed","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-assets/issues/128","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-assets","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-assets/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-assets/issues/128/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-assets/issues/128/events","html_url":"https://github.com/silverstripe/silverstripe-assets/issues/128","id":312218103,"number":128,"title":"Image extension and renderWith renders original image","user":{"login":"andreaslindahl","id":239697,"avatar_url":"https://avatars2.githubusercontent.com/u/239697?v=4","gravatar_id":"","url":"https://api.github.com/users/andreaslindahl","html_url":"https://github.com/andreaslindahl","followers_url":"https://api.github.com/users/andreaslindahl/followers","following_url":"https://api.github.com/users/andreaslindahl/following{/other_user}","gists_url":"https://api.github.com/users/andreaslindahl/gists{/gist_id}","starred_url":"https://api.github.com/users/andreaslindahl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreaslindahl/subscriptions","organizations_url":"https://api.github.com/users/andreaslindahl/orgs","repos_url":"https://api.github.com/users/andreaslindahl/repos","events_url":"https://api.github.com/users/andreaslindahl/events{/privacy}","received_events_url":"https://api.github.com/users/andreaslindahl/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-04-07T15:47:24Z","updated_at":"2018-04-08T20:55:43Z","closed_at":"2018-04-08T20:55:43Z","author_association":"NONE","body":"I don't know if this is a bug, or if I'm just being stupid, but here goes...\r\n\r\nI'm trying to extend SilverStripe\\Assets\\Image to add a custom method similar to Tag(), but which returns an image tag with some other attributes as well. Works great as long as I wish to show the original image. However, if I do for example `$Image.FillMax(400,400).TagLazyLoading` it always returns an image tag with the original image and not the resized one. My SS template is used, but the URL of the image refers to the original image.\r\n\r\nHere's the method in my extension class:\r\n\r\n```\r\npublic function getTagLazy() {\r\n    $url = $this->owner->getURL();\r\n        if (empty($url)) {\r\n            return \"\";\r\n        }\r\n        return $this->owner->renderWith(\"Includes/LazyImageTag\");\r\n}\r\n```\r\n\r\nAnd I register my extension in my YAML config like this:\r\n\r\n```\r\nSilverStripe\\Assets\\Image:\r\n  extensions:\r\n    - ImageExtension\r\n```\r\nAnd in my LazyImageTag.ss I just have this:\r\n\r\n`<img data-src=\"$URL.ATT\" alt=\"$Title.ATT\" />`"}}
{"actor":{"display_login":"tractorcow"}}