{"action":"created","issue":{"url":"https://api.github.com/repos/Levelmoney/resize-image-loader/issues/19","repository_url":"https://api.github.com/repos/Levelmoney/resize-image-loader","labels_url":"https://api.github.com/repos/Levelmoney/resize-image-loader/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/Levelmoney/resize-image-loader/issues/19/comments","events_url":"https://api.github.com/repos/Levelmoney/resize-image-loader/issues/19/events","html_url":"https://github.com/Levelmoney/resize-image-loader/issues/19","id":195040560,"number":19,"title":"Min and max sizes - rest automatically","user":{"login":"callumacrae","id":472830,"avatar_url":"https://avatars.githubusercontent.com/u/472830?v=3","gravatar_id":"","url":"https://api.github.com/users/callumacrae","html_url":"https://github.com/callumacrae","followers_url":"https://api.github.com/users/callumacrae/followers","following_url":"https://api.github.com/users/callumacrae/following{/other_user}","gists_url":"https://api.github.com/users/callumacrae/gists{/gist_id}","starred_url":"https://api.github.com/users/callumacrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callumacrae/subscriptions","organizations_url":"https://api.github.com/users/callumacrae/orgs","repos_url":"https://api.github.com/users/callumacrae/repos","events_url":"https://api.github.com/users/callumacrae/events{/privacy}","received_events_url":"https://api.github.com/users/callumacrae/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-12T17:49:46Z","updated_at":"2016-12-22T11:21:21Z","closed_at":null,"body":"Hey! I'm currently attempting to build this plugin into html-loader (or maybe a plugin): see here https://github.com/webpack/html-loader/issues/73\r\n\r\nI was wondering if you would accept a PR enabling this syntax:\r\n\r\n```js\r\nrequire('resize-image?min=200w&max=900w!./myImage.jpg');\r\n```\r\n\r\nFrom there, it'll calculate the best sizes (maybe another argument to say the number of images?), and generate the images.\r\n\r\nThis could be done from html-loader, but because it's being done automatically (in this case, from the sizes attribute), it might request images that are too big. As there is [no code checking that it's not making the image _bigger_](https://github.com/Levelmoney/resize-image-loader/blob/master/index.js#L95), that would be a Very Bad Thing™, so I think it makes most sense to do it in this plugin to avoid reading the image twice.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/Levelmoney/resize-image-loader/issues/comments/268780067","html_url":"https://github.com/Levelmoney/resize-image-loader/issues/19#issuecomment-268780067","issue_url":"https://api.github.com/repos/Levelmoney/resize-image-loader/issues/19","id":268780067,"user":{"login":"callumacrae","id":472830,"avatar_url":"https://avatars.githubusercontent.com/u/472830?v=3","gravatar_id":"","url":"https://api.github.com/users/callumacrae","html_url":"https://github.com/callumacrae","followers_url":"https://api.github.com/users/callumacrae/followers","following_url":"https://api.github.com/users/callumacrae/following{/other_user}","gists_url":"https://api.github.com/users/callumacrae/gists{/gist_id}","starred_url":"https://api.github.com/users/callumacrae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callumacrae/subscriptions","organizations_url":"https://api.github.com/users/callumacrae/orgs","repos_url":"https://api.github.com/users/callumacrae/repos","events_url":"https://api.github.com/users/callumacrae/events{/privacy}","received_events_url":"https://api.github.com/users/callumacrae/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T11:21:21Z","updated_at":"2016-12-22T11:21:21Z","body":"I wrote a library that can calculate the image size range from the sizes attribute: https://github.com/callumacrae/sizes-extent\r\n\r\nI'm using webpack's html-loader plugin, which can see the sizes attribute. I started a PR usingresponsive-loader (which also doesn't support this syntax): https://github.com/webpack/html-loader/pull/106"}}
{"actor":{"display_login":"callumacrae"}}