You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When someone copy/pastes an image into the BlockPy editor, you can set up hooks with BlockMirror to convert the image into a URL (potentially uploading it to a remote server along the way), and then returning some Python code to inject (that will be rendered as an image by BlockMirror in its respective editors).
The code that should be injected could vary in a few different ways, depending on what framework you are using. Both PIL and Pygame are popular choices for image manipulation, and we probably will ultimately create our own library that sits on one or both of them.
I think BlockPy could do a little witchcraft to check what packages are currently "loaded" (imported) in a user's code in order to provide a best guess about what they want. For example, if import pygame is found in the AST, then we can probably assume they want it to be a pygame image.
Ultimately, I'd like the following user experience:
User pastes an image into the editor
The image gets stored in the images associated with that submission
A filename is produced for that image relative to the current folder.
The following code gets injected (intelligently reusing any viable existing import)
When someone copy/pastes an image into the BlockPy editor, you can set up hooks with BlockMirror to convert the image into a URL (potentially uploading it to a remote server along the way), and then returning some Python code to inject (that will be rendered as an image by BlockMirror in its respective editors).
The code that should be injected could vary in a few different ways, depending on what framework you are using. Both PIL and Pygame are popular choices for image manipulation, and we probably will ultimately create our own library that sits on one or both of them.
I think BlockPy could do a little witchcraft to check what packages are currently "loaded" (imported) in a user's code in order to provide a best guess about what they want. For example, if
import pygame
is found in the AST, then we can probably assume they want it to be a pygame image.Ultimately, I'd like the following user experience:
import
)pygame.image.load("valid filename")
call as an imageThe user could then go into the Images tab to edit/replace/move the image.
The text was updated successfully, but these errors were encountered: