Open austin-schick opened 3 months ago
Notes from further conversation with Austin.
The reason we don't let you pass a PIL Image to redrawAll is that it will be slow. Creating a CMUImage wrapper around a PIL image will not help if you create the CMUImage in redrawAll. When you pass a string path to drawImage, we create a CMUImage wrapper and cache it that so that it is used the next time you draw. To fully fix this issue, we should add similar caching for PIL images passed directly to drawImage (including some check to see if the PIL image has been modified since the last draw) and then disallow creating CMUImages in redrawAll. Or something like that.
This is the error:
The reference to
.url
in this error is confusing, as is the reference toPngImageFile
. Improving this error would be good. Ideally we would even suggest a particular fix here, like "Did you forget to wrap a PIL image in a CMUImage"?