randomouscrap98 / contentapi

A generic content system to make some kinda standard websites
GNU General Public License v3.0
9 stars 2 forks source link

downscaling jpeg images #133

Closed 12Me21 closed 2 years ago

12Me21 commented 2 years ago

small downscaled jpeg files look really bad, because the format/quality is preserved. below a certain size, you should probably increase the jpeg quality setting, or convert to png. (for things like avatars, thumbnails, icons, etc.)

maybe have a ?png=true query param for /File/raw?

12Me21 commented 2 years ago

oh, and be careful of requests like api/File/raw/very-large-jpeg?png=true where, the image would look identical, but with a massively increased filesize This feature only makes sense for small images, so maybe set a size limit of ~300px or something?

randomouscrap98 commented 2 years ago

I'm pretty sure that filtering is also to blame, to downscaling algorithm is probably trash. But yeah the jpeg is probably a big part of it too. Hm... I can look into it. What sizes are we talking here, 50?

randomouscrap98 commented 2 years ago

completed with https://github.com/randomouscrap98/contentapi/commit/0fef94e00bdfc3e4ff81b54132fb02e2996127b3