I tried doing this myself, but since the download and resize operation blocks one of Flask's precious threads, it didn't scale well. (I'm sure it's workable, but I gave up)
Not sure, but maybe a way to weasel out of this could be to put this as a qworker job. Maybe copy a placeholder in the meantime (loading.{png|jpg|...}).
I tried doing this myself, but since the download and resize operation blocks one of Flask's precious threads, it didn't scale well. (I'm sure it's workable, but I gave up)
So as of https://github.com/kylewm/redwind/commit/c6b1a6b0bd9eef03899d6dbffb468255ed438ba7 I am delegating to a separate pilbox service running on the same server. pilbox runs on tornado so it doesn't have the same blocking issue, and I set up simple nginx caching on it to help with performance.