Assuming you want to do this on the server side, you can create a backing bean that uses the imageinfo class. It understands a number of image formats, including JPEG, GIF, PNG and BMP.
BWA HA HA HA HA HA HA! Tiny ad:
Gift giving made easy with the permaculture playing cards