-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Indeterminate result #66
Comments
Hi! Did you find a solution to this? I'm facing the same problem trying to write some test using mock data |
No, but I imagine forking this project might not be a bad idea, seeing how development on this project is not exactly super active. It doesn't seem like it should be awfully difficult to fix. (not meant to belittle the author - I'm sure he/she has other priorities) |
I also found that certain PNGs also produce an indeterminate result. I tried these:
This is just what I happen to have at hand. More testing is neccesary to get to a safe conclusion, but it seems like large PNG might be the possible culprit. I currently have no way to be sure how large is too large, if that's the problem. I'm pretty sure this is new. I've seen the above two failing PNGs work, but somehow it's now broken. |
Describe the bug
When passing a file that isn't an image, AND doesn't have a
type
, the function never produces a usable result. TheresponseUriFunc
is never called, and an error is never thrown.To Reproduce
Steps to reproduce the behavior:
new File([ /* presumably any data will do */ ], 'foo', { type: '' })
responseUriFunc
and any thrown errors by wrapping theResizer.imageFileResizer
in a try-catch.Expected behavior
Either of these options:
responseUriFunc
callback is called with an empty/undefined parameter. Not recommended, but it might be the last option if the above two can't work.I noticed in the source code that if the filetype is empty, you just carry on trying to resize the image, which isn't an image. Filetype could never be empty in practice. Any file that is resizable, must also be recognized by the browser, and therefor must also have a valid filetype. Letting empty filetypes through seems like a bad idea.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: