You can't call the getWidth() method on a file name. The name of a file is simply a string of text (
str data type), like "magic pink elephant" or "dragon wings", except that it happens to store the name of a file, like "gallery/owl.gif"
You also can't call .getWidth() on a
file object. You can read data from a file object that was opened for reading, or you can write data to a file object that was opened for writing, but you can't get the width of a file objet.
Instead, you need to create an Image object, and then you CAN call the getWidth() method on that Image object. (The Image object will be creating using the image file name, so that the Image object know what file to load in order to create itself as an image...)
The slides today had an example of creating an Image object, or you can look it up in the Graphics reference PDF, or the graphics chapter of the Zelle textbook.