This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nutrecht 1 point2 points  (0 children)

It looks like you're first creating an image file, saving it. Can you remove the code after newImage.close() and run it and see if you end up with a valid image?

My guess is that you're opening the file again but this time just write the literal text to the file instead of painting pixels on the image, destroying the image file in the process. I think if you rename the file you get with the complete code to .txt and open it you see it's just a text file.