toBlob is not a function
See original GitHub issueI tried to use pica but Exif was a big pain. Thank you for this package 😃
When I try to use it using the code below
let fr = new FileReader();
const reduce = require('image-blob-reduce')();
reduce.toBlob(fr.readAsBinaryString(file), {
max: 300,
unsharpAmount: 90,
unsharpRadius: 0.6,
unsharpThreshold: 2 })
.then(blob => {
addThumbnail(blob)
});
I got error
Uncaught (in promise) TypeError: reduce.toBlob is not a function
I could not get it worked. Is it me or something is wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Canvas toBlob is not recognized as a function in Chrome or IE
and it works fine to return the data but toBlob doesn't seem to work. Here is my JS and HTML. var canvas =...
Read more >Error: TypeError: data.image.toBlob is not a function · Issue #114
When I upload a file image, i get this error Error: TypeError: data.image.toBlob is not a function $('.wrapper').on('change', ...
Read more >HTMLCanvasElement.toBlob() - Web APIs | MDN
The HTMLCanvasElement.toBlob() method creates a Blob object representing the image contained in the canvas. This file may be cached on the ...
Read more >toBlob JavaScript and Node.js code examples - Tabnine
toBlob. function. Best JavaScript code snippets using toBlob(Showing top 15 results out of 315).
Read more >Canvas toBlob - JSFiddle - Code Playground
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Added pica options support and updated demo appropriately.
Is issue solved?
Did you browserified it (or use /dist instead)? Try demo src and
npm run demo
as playground. Also first param oftoBlob()
should be Blob or File, you should not try to.read*
it into something else. Just pass form field value as is. See how demo arrange this.Pica options (unsharp* and others) are no supported now https://github.com/nodeca/image-blob-reduce/blob/master/index.js#L120. We just started to search optimal api, because it’s a bit different for blobs. Now users are expected to override default methods or inject aditional actions. But you are right, probably we need something more simple for unsharp.