Closed monire91 closed 3 years ago
You should set minimum and maximum values as 1136x574. But ratio is preserved.
Resizer.imageFileResizer( event.target.files[0], 1136, 574, 'JPEG', 100, 0, uri => { console.log(uri) this.setState({ newImage: uri }) }, 'base64', 1136, 574, );
@onurzorluer, it's not working for me, did I miss something? The compression is working perfectly tho. Thanks you,
const file = e.target.files[0];
return new Promise((resolve) => {
Resizer.imageFileResizer(file, 300, 250, "JPEG", quality, 0, (uri) => { resolve(uri); }, "blob", 300, 250);
});
@gabgagnon Resizer.imageFileResizer(file, 300, 250, "JPEG",
quality,0, (uri) => { resolve(uri); }, "blob", 300, 250);
You must give numerical value to the quality parameter.
Must be: Resizer.imageFileResizer(file, 300, 250, "JPEG",
100,0, (uri) => { resolve(uri); }, "blob", 300, 250);
Is your feature request related to a problem? Please describe. Im not sure Describe the solution you'd like a snippet on how to get target size say 1136x574
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.