Drupal 7 ships with image handling in core, which is two tons of awesome. How the system works is that site builders create different image styles via the UI specifying the required processing, the most common being resizing. The image markup is rendered via Drupal's theme layer and sent of the end user, and when the browser interprets the page it requests a cached version of the styled image. If it exists, the web server returns it. If not, the Drupal application creates the styled image, writes the cached file, and then returns it to the end user.
But what if you want to read the contents