From b9718cd4846f85dae8d39b927342d6344959a91e Mon Sep 17 00:00:00 2001 From: Ali Abid Date: Wed, 5 Aug 2020 17:25:27 -0700 Subject: [PATCH] fix image resizing --- .../static/js/interfaces/input/image.js | 20 +++++++++---------- gradio/static/js/interfaces/input/image.js | 20 +++++++++---------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/build/lib/gradio/static/js/interfaces/input/image.js b/build/lib/gradio/static/js/interfaces/input/image.js index 7528281b50..2a47539973 100644 --- a/build/lib/gradio/static/js/interfaces/input/image.js +++ b/build/lib/gradio/static/js/interfaces/input/image.js @@ -107,17 +107,15 @@ const image_input = { image_data: null, set_image_data: function(data, update_editor) { let io = this; - resizeImage.call(this, data, 600, 600, function(image_data) { - io.image_data = image_data - io.target.find(".image_preview").attr('src', image_data); - if (update_editor) { - io.tui_editor.loadImageFromURL(io.image_data, 'input').then(function (sizeValue) { - io.tui_editor.clearUndoStack(); - io.tui_editor.ui.activeMenuEvent(); - io.tui_editor.ui.resizeEditor({ imageSize: sizeValue }); - }); - } - }) + io.image_data = data + io.target.find(".image_preview").attr('src', data); + if (update_editor) { + io.tui_editor.loadImageFromURL(io.image_data, 'input').then(function (sizeValue) { + io.tui_editor.clearUndoStack(); + io.tui_editor.ui.activeMenuEvent(); + io.tui_editor.ui.resizeEditor({ imageSize: sizeValue }); + }); + } }, load_preview_from_files: function(files) { if (!files.length || !window.FileReader || !/^image/.test(files[0].type)) { diff --git a/gradio/static/js/interfaces/input/image.js b/gradio/static/js/interfaces/input/image.js index 7528281b50..2a47539973 100644 --- a/gradio/static/js/interfaces/input/image.js +++ b/gradio/static/js/interfaces/input/image.js @@ -107,17 +107,15 @@ const image_input = { image_data: null, set_image_data: function(data, update_editor) { let io = this; - resizeImage.call(this, data, 600, 600, function(image_data) { - io.image_data = image_data - io.target.find(".image_preview").attr('src', image_data); - if (update_editor) { - io.tui_editor.loadImageFromURL(io.image_data, 'input').then(function (sizeValue) { - io.tui_editor.clearUndoStack(); - io.tui_editor.ui.activeMenuEvent(); - io.tui_editor.ui.resizeEditor({ imageSize: sizeValue }); - }); - } - }) + io.image_data = data + io.target.find(".image_preview").attr('src', data); + if (update_editor) { + io.tui_editor.loadImageFromURL(io.image_data, 'input').then(function (sizeValue) { + io.tui_editor.clearUndoStack(); + io.tui_editor.ui.activeMenuEvent(); + io.tui_editor.ui.resizeEditor({ imageSize: sizeValue }); + }); + } }, load_preview_from_files: function(files) { if (!files.length || !window.FileReader || !/^image/.test(files[0].type)) {