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

Extend interface to support compression #2

@nononoah

Description

@nononoah

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions