Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Extend interface to support compression #2

Open
nononoah opened this issue Aug 14, 2016 · 1 comment
Open

Extend interface to support compression #2

nononoah opened this issue Aug 14, 2016 · 1 comment

Comments

@nononoah
Copy link

nononoah commented Aug 14, 2016

Summary

By providing images of arbitrary dimensions, image-resizer allows resource-tight mobile clients to restrict image downloads so that the width and height of the image is no larger than required. This feature request extends that aspect of the API by providing parameters for compression.

Goals

  • Clients should be able to specify a maximum file size. When the source image exceeds this file size, image-resizer will compress it. Otherwise, no compression will take place.
  • Clients should be able to specify a minimum quality. If compression would reduce an image beneath this quality, no compression will take place.
  • Clients should be able to specify a maximum quality. Compression will reduce the image down to its maximum quality.

Notes

Note that I've arbitrarily specified that "minimum wins" over all other parameters. While this suits my intended usecases, this may not be generally preferable.

Note that I have not specified file format handling. For the moment, I think it best if we leave that for another day, and that image-resizer take a simple route here, such as returning the image in the file format of its source or always returning images of a specific format. Whatever the case is, it should be documented.

Suggested parameter additions
max_file_size
min_quality
max_quality

@SimantovYousoufov
Copy link
Contributor

See #3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants