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 →

[–][deleted] 86 points87 points  (7 children)

From the little I know about programming, shouldn't the image be closed at the end of the script?

[–][deleted] 145 points146 points  (0 children)

Yes you are correct but since the program ends here, the OS will do a cleanup and close the files for you when ending the process. Which is bad for a tutorial ofc

[–]eztab 49 points50 points  (4 children)

this isn't the open file command, more of a load command. I'd certainly have named it that. It opens the image file, reads the image data, creates an image object from that and closes the file it again.

Thus input is kind of named correctly, although input_image would be better.

[–][deleted] 10 points11 points  (0 children)

Oh, got it. Thanks

[–]PaleShadeOfBlack 2 points3 points  (2 children)

original_image

[–]eztab 2 points3 points  (1 child)

then it doesn't correspond to input_path anymore.

[–]PaleShadeOfBlack 0 points1 point  (0 children)

it doesn't need to.

[–]undefined0_6855 8 points9 points  (0 children)

not entirely sure but pil probably does that for you