@CookieRevised: Okay, I understand that you don't
need a complete script file with a fully functional class to
just read the dimensions of the image.
But heck, as a script developer I prefer a clear overall structure so I know where I can easily find my functions. And when I group related methods in a single library file, it's much easier to extend that with extra methods since you'll probably already have a decent base to built on.
I have to admit I didn't know about how to read the size of the PNG binary - thanks for that! Still, I think it's more of a hassle when you need different functions for different image formats (PNG, JPG, GIF) when you can use a universal image library which does just the same.
Ah well, it appears to be a matter of your own taste... Maybe I'm spoiled by all the OOP goodness the most recent frameworks and programming languages offer (.NET, PHP, jQuery,...). Maybe I don't want to dive into dealing with bytes and binaries any more. Well, then so be it!