Scratch-gui: Add loading sprites from URLs

Created on 16 Jun 2018  路  5Comments  路  Source: LLK/scratch-gui

Expected Behavior

_Please describe what should happen_

When I add a new sprite e.g. for minecraft, I surf the internet, find a picture.
I would like to include this picture by its URL.

Actual Behavior

_Describe what actually happens_

I need to download and save the picture. Then, I can upload it from my computer.

Steps to Reproduce

_Explain what someone needs to do in order to see what's described in Actual behavior above_

  1. Click on the Sprite+ Button in the bottom-right corner.
  2. Click on upload

Operating System and Browser

_Firefox 52, Linux_

feature request

Most helpful comment

@hedgehog125 @niccokunzmann I can see many problems with this:

  • A potential reason for wanting direct loading from URL is that you are on a device without much storage or with a slow internet connection, in which case downloading and then re-uploading could be problematic

  • There is no drag-and-drop on mobile devices

  • In some browsers, dragging a file into the browser window causes the browser to open the file in the tab that the file is dropped into (thereby closing whatever is in the current tab). I had some issues with this in 2.0.

  • Users of low-end hardware may find that this process is very slow because it takes a while for their file manager to load.

All 5 comments

I'm not sure this is (entirely) possible, because many sites prevent cross-origin resource sharing (CORS). So, if Scratch tries to make a fetch to download an image on a domain without CORS, the browser prevents the request and the image doesn't load. Snap!, an editor/programming language based on Scratch, does let you drag an image from a separate webpage to load it into the editor, but if you try to drag in an image from somewhere that blocks CORS, it'll show a message. Implementing this into Scratch would have to work the same way.

@towerofnix I can't see a problem with it working that way, but something would need to be added to the URL pasting window to let people know not to post the failure of this feature in the Suggestions or Bugs & Glitches forum. Obviously which sites will/won't allow CORS requests is beyond ST's control.

Maybe a compromise could be that you could drag and drop from your computer?

Dragging and dropping would be a great compromise.

  1. You do not need to open the upload window.
  2. this allows dragging and dropping it from other browser windows as I
    understand.

This way, it is fast and in many cases聽 a familiar interaction for users.

@hedgehog125 @niccokunzmann I can see many problems with this:

  • A potential reason for wanting direct loading from URL is that you are on a device without much storage or with a slow internet connection, in which case downloading and then re-uploading could be problematic

  • There is no drag-and-drop on mobile devices

  • In some browsers, dragging a file into the browser window causes the browser to open the file in the tab that the file is dropped into (thereby closing whatever is in the current tab). I had some issues with this in 2.0.

  • Users of low-end hardware may find that this process is very slow because it takes a while for their file manager to load.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ntlrsk picture ntlrsk  路  3Comments

ericrosenbaum picture ericrosenbaum  路  4Comments

chrisgarrity picture chrisgarrity  路  4Comments

ericrosenbaum picture ericrosenbaum  路  3Comments

davidaylaian picture davidaylaian  路  4Comments