Strongly tied to #2, since image support requires it.
Reading images means that we would need to process content-type and content-length. BufReader has a default capacity of 8KB, which will would need to expand if we wish to have normal-sized images.
Another thing is that, at the moment, I am unaware of any ways to figure out where the image ends apart from trusting content-type.
Maybe a different BufReader could be made for images specifically, but that would require some hacking.
Also probably needs the http::Request to become a trait.
Strongly tied to #2, since image support requires it.
Reading images means that we would need to process `content-type` and `content-length`. `BufReader` has a default capacity of 8KB, which will would need to expand if we wish to have normal-sized images.
Another thing is that, at the moment, I am unaware of any ways to figure out where the image ends apart from trusting `content-type`.
Maybe a different `BufReader` could be made for images specifically, but that would require some hacking.
Also probably needs the `http::Request` to become a trait.
1651126606 adds support for binary responses, so we can now serve images, like with favicon.ico.
I'm not sure how to serve post images yet, I'm thinking /<post_id>/img should be good enough.
1651126606 adds support for binary responses, so we can now serve images, like with `favicon.ico`.
I'm not sure how to serve post images yet, I'm thinking `/<post_id>/img` should be good enough.
Technically works as of 06d2d7a957, just needs #1 to actually look good.
There are a few problems, namely
the filename and metadata are ignored (this I can live with)
the image is served as <id>/img, which makes the browser save it as img.<ext> which is problematic because I would much prefer <id>.<ext>
there is no way to extract images from the database (this I can also live with)
In any case, the last problem can be solved by making an utility for it (presumably in bin/), which should be easy enough.
Technically works as of 06d2d7a957, just needs #1 to actually look good.
There are a few problems, namely
+ the filename and metadata are ignored (this I can live with)
+ the image is served as `<id>/img`, which makes the browser save it as `img.<ext>` which is problematic because I would much prefer `<id>.<ext>`
+ there is no way to extract images from the database (this I can also live with)
In any case, the last problem can be solved by making an utility for it (presumably in `bin/`), which should be easy enough.
Strongly tied to #2, since image support requires it.
Reading images means that we would need to process
content-type
andcontent-length
.BufReader
has a default capacity of 8KB, which will would need to expand if we wish to have normal-sized images.Another thing is that, at the moment, I am unaware of any ways to figure out where the image ends apart from trusting
content-type
.Maybe a different
BufReader
could be made for images specifically, but that would require some hacking.Also probably needs the
http::Request
to become a trait.1651126606
adds support for binary responses, so we can now serve images, like withfavicon.ico
.I'm not sure how to serve post images yet, I'm thinking
/<post_id>/img
should be good enough.Technically works as of
06d2d7a957
, just needs #1 to actually look good.There are a few problems, namely
<id>/img
, which makes the browser save it asimg.<ext>
which is problematic because I would much prefer<id>.<ext>
In any case, the last problem can be solved by making an utility for it (presumably in
bin/
), which should be easy enough.