Install the FFMPEG tool suite and use the ffprobe program.
FFMPEG
ffprobe
Example:
% ffprobe -v quiet -show_entries stream=width,height street.jpg [STREAM] width=1280 height=960 [/STREAM] %