-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
loadImageFromFile and loadImageFromURL silently fail for unrecognized image formats #116
Labels
Comments
I just ran into the same issue. I'd really like to see this getting fixed. |
junghwan-park
added a commit
that referenced
this issue
Jan 10, 2019
7 tasks
HerlinMatos
pushed a commit
to EveryMundo/tui.image-editor
that referenced
this issue
Jul 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
tui-image-editor.js 3.3.0
Development Environment
Windows 7
Chrome 71
Firefox 64
Current Behavior
Attempting to load unrecognized image formats cause an exception in the image editor that cannot be caught.
Normally one would attempt to use loadImageFromFile or loadImageFromURL in a promise construct like:
However, if the image cannot be successfully loaded, the image editor throws and exception that bypasses the ".catch()" function.
Also, wrapping the loadImageFromFile in a native try/catch handler does not help either.
This behavior makes it difficult to know if the editor actually loaded the image successfully.
Steps to Reproduce:
Suggestion:
On line 15184 of dist/tui-image-editor.js, the following code is found:
Consider enhancing the test to
This allows the promise to be rejected and handled by the client code.
Expected Behavior
The .catch function for the promises returned by loadImageFromURL and loadImageFromFile should be called if the image cannot be loaded.
The text was updated successfully, but these errors were encountered: