Hopefully it's not too late, but be careful doing this. When you load an image from a file this way, it leaves an open handle to the image in question (so it can't be renamed, deleted, moved, etc...).
If this isn't an issue for you then you're set, but if it could be (and sometimes it's good to err on the side of caution), you can load it into memory and then load the image from the in-memory copy of the image, closing the file handle to the file itself.
Comment