If you want to determine the size of an image file on a Linux system, for some types of image files, e.g., PNG or GIF files, you can just use the file command. E.g.:
$ file ~/Documents/System_Memory.png /home/jdoe/Documents/System_Memory.png: PNG image data, 800 x 600, 8-bit/color RGBA, non-interlaced $ file ~/Documents/recipes/asparagus-strawberry-salad.gif /home/jdoe/Documents/recipes/asparagus-strawberry-salad.gif: GIF image data, version 89a, 250 x 153 $
But if you obtain information on a JPG/JPEG file with that command, it doesn't provide any information on the dimensions of the image.
$ file ~/Documents/Winter.jpg /home/jdoe/Documents/Winter.jpg: JPEG image data, JFIF standard 1.02 $
If you install the exiv2 package, you can also display the dimensions of JPEG images as well as PNG, GIF, and other image formats.
$ exiv2 /home/jdoe/Documents/Winter.jpg File name : /home/jdoe/Documents/Winter.jpg File size : 105542 Bytes MIME type : image/jpeg Image size : 800 x 600 /home/jdoe/Documents/Winter.jpg: No Exif data found in the file $ exiv2 /home/jdoe/Documents/System_Memory.png File name : /home/jdoe/Documents/System_Memory.png File size : 135335 Bytes MIME type : image/png Image size : 800 x 600 /home/jdoe/Documents/System_Memory.png: No Exif data found in the file $ exiv2 /home/jdoe/Documents/recipes/asparagus-strawberry-salad.gif File name : /home/jdoe/Documents/recipes/asparagus-strawberry-salad.gif File size : 31346 Bytes MIME type : image/gif Image size : 250 x 153 /home/jdoe/Documents/recipes/asparagus-strawberry-salad.gif: No Exif data found in the file $
[ More Info ]