Skip to content

Commit

Permalink
print error if image format gives trouble #429
Browse files Browse the repository at this point in the history
  • Loading branch information
io53 committed Aug 14, 2024
1 parent afdaeba commit 0def786
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BackgroundUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ let uploadBackgroundImage = (sensor, f, t, doneCB) => {
let reader = new FileReader();
reader.onload = readerEvent => {
let image = new Image();
image.onerror = () => {
notify.error(t("image_format_not_supported"));
doneCB(null);
};
image.onload = () => {
let canvas = document.createElement('canvas'),
max_size = pjson.settings.uploadImageMaxSize,
Expand Down

0 comments on commit 0def786

Please sign in to comment.