21

What's the simplest and quickest way to display the dimensions of a folder containing images? There doesn't appear to be an option to do this in Nautilus. There's only so many right-click file > Properties > Image operations I can perform, before losing the will to live.

4

Use a script! For things not in Nautilus by default you can add scripts yourself.

More information on ubuntuforums. The topic starts out adding music information but from reply #32 it also involves images. Scripts (use at own risk) and instructions in the link.

Look at the screenshot for how this will look (it's for an older Ubuntu but this still works):

enter image description here

3
  • 1
    I should have said in my original post that I also tried installing nautilus-columns package: $ sudo add-apt-repository ppa:nilarimogard/webupd8 $ sudo apt-get update $ sudo apt-get install nautilus-columns I then added all image-related columns to Nautilus' view and restarted Nautilus. Date, EXIF Dateshot, EXIF Image Size, EXIF Software, EXIF Flash columns are all blank. The only column that displays info is Image Size, which displays the dimensions of each image. Any idea how to resolve this before looking into custom scripts? Do I need to install another package(s)? Thanks – unpossible May 24 '11 at 5:56
  • Update: I installed the bsc-v2.py script on Ubuntu 10.10 PC at work, as per instructions on ubuntuforums thread, which works. Whilst installing Ubuntu 11.04 at home, I selected option to encrypt my home directory. I suspect this may be the cause of this issue, as I had a similar issue with Apache trying to serve files and folders in my home directory. – unpossible May 26 '11 at 11:46
  • Update: I removed encryption from my home folder on 11.04, but the EXIF data is still blank. Has anyone managed to get this working on Natty? If so, how? – unpossible Jun 2 '11 at 17:18
8

There is a package called nautilus-columns. I currently find it only in a PPA, which is documented here. With this little script its easy to add columns for various meta data for PDF, images, sound files etc. To sum all things up:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install nautilus-columns
nautilus -q

Finally go to Edit > Preferences > List Columns and enable all you need. Please note, its only working for the List-View.

Current versions of nautilus-columns can also be found here.

2
  • 1
    Works in 13.04 too – Umair A. Oct 26 '13 at 17:41
  • 1
    Works with 16.04. The one thing I will point out to future readers is to remember that 'exif image size' will be different than 'image size', so check the box for 'image size' if you want the true image size, not the image dimensions when the photo was taken or exif was last updated. – Hastig Zusammenstellen Feb 16 '17 at 6:41
4

Run this from a terminal (works for PNG and GIF images):

file *.{png,gif}

That works because the file command shows the dimensions for PNG and GIF images, as well as some other information. Your shell expands *.{png,gif} to a list of filenames, and the file command accepts multiple filename arguments. It looks like this:

btvs-cordelia-probable-syntax-error.png: PNG image data, 1920 x 1080, 8-bit/color RGB, non-interlaced
cross.png:                               PNG image data, 1039 x 611, 8-bit/color RGB, non-interlaced

Notice that the columns are lined up, so extra space is used if some names are much longer than others. If you don't want that, use the -N option:

file -N *.{png,gif}

That gives you lines like this, which no longer take up extra space, but are no longer aligned:

btvs-cordelia-probable-syntax-error.png: PNG image data, 1920 x 1080, 8-bit/color RGB, non-interlaced
cross.png: PNG image data, 1039 x 611, 8-bit/color RGB, non-interlaced

In the rare case where you have many thousands of image files, their names might exceed the maximum combined argument length, and the shell would give you an error message. In that case, you could use a loop like this:

for f in *.{png,gif}; do file "$f"; done

That produces the same results as file -N because, since file only knows about one file per run, so it doesn't know how long the other filenames are and it cannot align the columns.

For other image types, see ypnos's answer to Fast way to get image dimensions (not filesize).

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.