Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target file size #21

Open
zehawki opened this issue Feb 18, 2020 · 0 comments
Open

Target file size #21

zehawki opened this issue Feb 18, 2020 · 0 comments

Comments

@zehawki
Copy link

zehawki commented Feb 18, 2020

Hello, may I make a feature request - take a target file size as a prop, and allow fixing 1 or more levers to achieve roughly that file size.

I.e. file size is a result of 2 levers - resolution and compression in case of JPG. So we could set resolution as fixed, while the compression can be auto varied to hit (around) target file size. Or vice versa - i.e. compression is fixed, while the resolution can be auto changed. Or both can be varied, etc etc.

A small iterative algo could loop through some trials and provide the best fit within say 5 trials or some such. Obviously this can be implemented outside this component, and just iteratively call the component with different params till the size is achieved, but why not bake this inside your component?

I would imagine this is a rather standard usecase for uploading images, and a robust solution would be quite beneficial.

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

No branches or pull requests

1 participant