Closed OverStruck closed 3 years ago
Currently the module only support blob or base64 for outputType.
blob
base64
outputType
This commit adds support for a 3rd option: file which will return a File JavaScript object.
file
This is useful for resizing images that are meant to be uploaded as files.
I.e. this can be used to send a file to a flask app that uses FileStorage class.
FileStorage
Example:
const resizeFile = file => new Promise(resolve => { Resizer.imageFileResizer(file, 1000, 1000, "jpeg", 100, 0, file => resolve(file), "file" ); });
The returned File object will have the same name as the original image.
File
This also addresses some concerns such as issue #19 and #38
@all-contributors please add @OverStruck for code and maintenance
@onurzorluer
I've put up a pull request to add @OverStruck! :tada:
Currently the module only support
blob
orbase64
foroutputType
.This commit adds support for a 3rd option:
file
which will return a File JavaScript object.This is useful for resizing images that are meant to be uploaded as files.
I.e. this can be used to send a file to a flask app that uses
FileStorage
class.Example:
The returned
File
object will have the same name as the original image.This also addresses some concerns such as issue #19 and #38