Java has this method: getWidth(ImageObserver observer)
It returns the Width of an image. This method seems simple enough until you get to the part where an ImageObserver is requiered. What is the purpose of the ImageObserver as a parameter. Is there any other way around this?
Note that I can't just use an ImageIcon as mentioned here: Getting Height and Width of Image in Java without an ImageObserver The reason is because I will ultimately be loading my image from a JFileChooser. This is also why I can't just use constants for the Height and Width. I don't know which picture the user will be wanting to use.
Also, I don't feel like I should post my code for these two reasons
A) My code is not anywhere close to being a SSCCE piece of code: http://sscce.org/
B) This is such a general question that I feel my code would be too specific.