imgflo / imgflo-server

HTTP image processing server based on imgflo
48 stars 7 forks source link

Support maxwidth/maxheight constraints #58

Open jonnor opened 8 years ago

jonnor commented 8 years ago

Right now we have universal height/width support, with possibility of specifying only one of these and original aspect ratio will be used. However, on images with very wide/tall aspect ratios this can be far from what UIs expect. One strategy used is to say, give me an image where height is up to N and width is up to N.

Also, the semantics of height/width is to provide exactly the dimensions specified, making it not possible for us to return cached (already processed) very-similar-but-not-100% over. A challenge is that currently we do assume a 1-to-1 mapping of request parameters and an output image. With loose constraints like this, there is a large number of outputs possible.

This can potentially help in consolidating image sizes requested by clients, which reduces costs, and improves responsiveness for users due to higher cache hit ratios.