{"action":"created","issue":{"url":"https://api.github.com/repos/theCrag/website/issues/2029","labels_url":"https://api.github.com/repos/theCrag/website/issues/2029/labels{/name}","comments_url":"https://api.github.com/repos/theCrag/website/issues/2029/comments","events_url":"https://api.github.com/repos/theCrag/website/issues/2029/events","html_url":"https://github.com/theCrag/website/issues/2029","id":104175989,"number":2029,"title":"Install and configure dynamic image resize and deprecate image resizing processes","user":{"login":"brendanheywood","id":187449,"avatar_url":"https://avatars.githubusercontent.com/u/187449?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanheywood","html_url":"https://github.com/brendanheywood","followers_url":"https://api.github.com/users/brendanheywood/followers","following_url":"https://api.github.com/users/brendanheywood/following{/other_user}","gists_url":"https://api.github.com/users/brendanheywood/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanheywood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanheywood/subscriptions","organizations_url":"https://api.github.com/users/brendanheywood/orgs","repos_url":"https://api.github.com/users/brendanheywood/repos","events_url":"https://api.github.com/users/brendanheywood/events{/privacy}","received_events_url":"https://api.github.com/users/brendanheywood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/theCrag/website/milestones/44","html_url":"https://github.com/theCrag/website/milestones/Release%2046%20-%20Dynamic%20image%20resizing","labels_url":"https://api.github.com/repos/theCrag/website/milestones/44/labels","id":1298780,"number":44,"title":"Release 46 - Dynamic image resizing","description":"The purpose of this release is to remove the bottlenecks created with the way we are handling images\r\n\r\n-----\r\n\r\nPRE RELEASE","creator":{"login":"scd","id":373058,"avatar_url":"https://avatars.githubusercontent.com/u/373058?v=3","gravatar_id":"","url":"https://api.github.com/users/scd","html_url":"https://github.com/scd","followers_url":"https://api.github.com/users/scd/followers","following_url":"https://api.github.com/users/scd/following{/other_user}","gists_url":"https://api.github.com/users/scd/gists{/gist_id}","starred_url":"https://api.github.com/users/scd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scd/subscriptions","organizations_url":"https://api.github.com/users/scd/orgs","repos_url":"https://api.github.com/users/scd/repos","events_url":"https://api.github.com/users/scd/events{/privacy}","received_events_url":"https://api.github.com/users/scd/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":15,"state":"open","created_at":"2015-09-10T04:43:17Z","updated_at":"2015-10-02T23:23:47Z","due_on":"2015-10-29T13:00:00Z","closed_at":null},"comments":7,"created_at":"2015-09-01T03:16:58Z","updated_at":"2015-10-03T12:02:16Z","closed_at":null,"body":"High level:\r\n\r\n* [ ] original images should be stored, but never served directly\r\n* [ ] all images served over the web should go through a dynamic resize pipeline and cached, allowing us to save a lot of disk wasted by pre-emptive resizing, and allow us to use new sizes on the fly without any processing at all\r\n* [ ] all image serving is done with general best practice, no cookies, proper cache headers, well tuned compression, dynamic content negotiation etc\r\n* [ ] rotation is done dynamically as serving time, not upload time. This fixes the root cause issue we currently have where we can't far future expires an image as it may be rotated.\r\n\r\nCurrent tool of choice is:\r\n\r\nhttp://thumbor.org/\r\n\r\nRough todo list:\r\n\r\n* [ ] install thumbor, served off static\r\n* [ ] change upload process for topos and photos to just dump a photo into a storage directory and that's it.\r\n* [ ] the process then blindly refers to the thumbnail url using the thumbor url api, which won't exist to thumbor goes off, makes it, then serves it\r\n* [ ] if the user thinks the url needs rotating, they click clockwise or anticlockwise, we tore this just as metadata and don't touch the image, then swp the url to the new url\r\n* [ ] the new rotated url doesn't so thumbor does everything again, but it's a different url so both are cached\r\n* [ ] This also means that we can safely rotate the image at any time in the future, and all versions, sizes and rotatedness will all be cached both on disk and in the browser\r\n* [ ] the data that gets sent to the templates should be the rotated dimensions so the templates don't need to worry about rotation\r\n* [ ] make a webhelper function to handle the url creation. Needs to handle cases like smart cropping of a rectangular image down to a square thumbnail\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/theCrag/website/issues/comments/145243114","html_url":"https://github.com/theCrag/website/issues/2029#issuecomment-145243114","issue_url":"https://api.github.com/repos/theCrag/website/issues/2029","id":145243114,"user":{"login":"brendanheywood","id":187449,"avatar_url":"https://avatars.githubusercontent.com/u/187449?v=3","gravatar_id":"","url":"https://api.github.com/users/brendanheywood","html_url":"https://github.com/brendanheywood","followers_url":"https://api.github.com/users/brendanheywood/followers","following_url":"https://api.github.com/users/brendanheywood/following{/other_user}","gists_url":"https://api.github.com/users/brendanheywood/gists{/gist_id}","starred_url":"https://api.github.com/users/brendanheywood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendanheywood/subscriptions","organizations_url":"https://api.github.com/users/brendanheywood/orgs","repos_url":"https://api.github.com/users/brendanheywood/repos","events_url":"https://api.github.com/users/brendanheywood/events{/privacy}","received_events_url":"https://api.github.com/users/brendanheywood/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T12:02:16Z","updated_at":"2015-10-03T12:02:16Z","body":"Ok some rough general todos:\r\n\r\n* [ ] use original not modified:\r\nhttp://static.thecrag.com:8888/unsafe/300x200/http://www.thecrag.com/image/photo/00003/original/724238361\r\n\r\n* [ ] configure the filesystem loaded instead of the http loader, and graft the route onto static (via /t/ ?) https://github.com/thumbor/thumbor/wiki/Configuration#file_loader_root_path)\r\n\r\n> http://static.thecrag.com/t/300x200/photo/00003/original/724238361\r\n\r\n* [ ] test it still all works via https\r\n\r\n> https://static.thecrag.com/t/300x200/photo/00003/original/724238361\r\n\r\n* [ ] get rid of safe mode and get client running on dev to sign the urls https://github.com/thumbor/thumbor/wiki/Configuration#security_key\r\n\r\n> https://static.thecrag.com/t//cryptohash300x200/photo/00003/original/724238361\r\n\r\n* [ ] get AUTO_WEBP = true serving turned on\r\n\r\n> https://static.thecrag.com/t/blahblahblah/300x200/photo/00003/modified/724238361.jpg\r\n\r\n* [ ] get cahe and expire headers configured right, at the moment isn't far futures and has caching off, assume this is due to the unsafe mode stuff so may just start working right after that's fixed\r\n\r\n* [ ] I don't mind face detection on for avatars, I'm on the fence for the general climbing pics (probably off), but they should definitely be off for the topos. May be better to just turn them all off for the first rollout\r\n\r\n* [ ] check MAX_WIDTH and MAX_HEIGHT, we will be sending some big images some times (find a big image to test)\r\n\r\n* [ ] given that rotate is just another filter, and it's desirable to give access to the templates to use other filters (blur, colorize, rounded corners, there are a bunch I had immediate ways to use in different places), it seems that the addition of the rotate() has to be done in the templates rather than the backend sending a preformed url\r\n \r\n\r\n"}}