Running Drawbot 3.128.
Posts made by rduritsa
-
RE: PIL or Pillow installation issues and PNG metadata
-
PIL or Pillow installation issues and PNG metadata
Hello. I am looking to edit/append metadata to exported png files from Drawbot. After doing some research, it looks like the pillow PIL library can do something like this:
from PIL import image targetImage = Image.open("testimage.png") targetImage.info["MyNewString"] = "A string" targetImage.info["MyNewInt"] = 1234 targetImage.save("test images/addedData.png")
But I tried to install pillow through the Drawbot "Install Python Packages..." terminal and it looks like it installed successfully, but when I run the "from PIL import image" line in my code, it gives me the following error:
ImportError: cannot import name 'image' from 'PIL' (/Users/username/Library/Application Support/DrawBot/Python3.7/PIL/init.py)
That is the correct directory where it should be looking. Interestingly enough if I go outside Drawbot to Mac Terminal, then run the python version command (python3 -V), it says I am running Python 3.8.9. Strange because I can't find any evidence on my machine that version 3.8.9 is installed. Does anyone have any ideas on what the issue could be? Many thanks in advance for any help.
-
How to stop (Kill) an accidental infinite loop without force quitting?
Every now and then, I will do a bone-headed thing like create an infinite loop that causes Drawbot (python) to give me the spinning ball of death until I have to force quit to stop the process. Unfortunately, this also deletes any unsaved progress in open documents. Most Python environments in my experience have some sort of key command that will break, kill, or otherwise end Python's infinite loop and allow you to go back to editing without losing work. Is there such a command in Drawbot? I have not found anything anywhere that mentions it. I save my work often now because of this, but it seems like something that would have been considered during app development.
Does anyone know a solution to ending the Drawbot process without losing work? Many thanks in advance.