You might mention somewhere that this function also rotates the image if it has EXIF rotation, since that is a pretty important part of what it is used for.