The command "file filename" will display specifics about the file. For .jpg files it reports the file's resolution in DPI as the 10th and 12th fields in the output if using whitespace as delimeters. The command "ls -l filename" will give the file size in bytes as the 5th field if using whitespace as delimeters. All you need to do in perl is execute these 2 commands and extract the desired information from their outputs. Sorry I can't be more helpful as I am just beginning to explore perl for web page design.
To get you started here's a small perl script
#!/usr/bin/perl
system "file /etc/passwd > perltest";
system "ls -l /etc/passwd >> perltest";
system "cat perltest";
Be sure to chmod the file first to make it executable (r-x or rwx) before testing.
This script redirects the output of the file and ls commands into a file named perltest (empties the file first if it exists) and then copues the contents of the file to the screen. You could open the file and parse it looking for the specific data you are interested in.
Good Luck!