I have a huge folder of images that I've collected over the years that my students use for coursework. It started off with about twenty images so I didn't really bother with file names or any kind of structure, just tagged them and chucked them in. That same folder now has about 5000 images in it and it's getting to the point where it's hard to work with.
Ideally I'd like to be able to run a command (now and in the future as more are submitted) that would look at the images tag(s) and create a directory with the name of the tag and move that image into it, or if a previous image has already created that directory simply move the image into that directory.
I'm not sure I'm doing a very good job explaining this.
The first 5 images for example are cars - BMW, Honda, Ford, Alfa Romeo and another BMW. The file names are all unique - they're all in the same folder remember. So after the running this mythical script I'd have 4 folders with the 2 images in the BMW one.
Everything is tagged in Shotwell, it's mostly JPGs with a few PNGs thrown in just to complicate things! There could be multiple tags but 95% are just single ones. I'm not sure where the tags are stored but I'm assuming in each file since the tags show up on both my computers but were only ever tagged on the main one.
Further investigation has shown that the tags are being stored against the individual image's 'keywords' so maybe I should be asking how to create directories based on its keywords?
I'm very much learning as I go here!
If it helps, this is the output from the exiftool
:
$ exiftool 010.jpg
ExifTool Version Number : 10.10
File Name : 010.jpg
Directory : .
File Size : 274 kB
File Modification Date/Time : 2016:04:23 21:03:59+01:00
File Access Date/Time : 2016:04:23 21:03:59+01:00
File Inode Change Date/Time : 2016:04:23 21:03:59+01:00
File Permissions : rw-rw-r--
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : inches
X Resolution : 72
Y Resolution : 72
Exif Byte Order : Little-endian (Intel, II)
Software : Shotwell 0.22.0
XMP Toolkit : XMP Core 4.4.0-Exiv2
Subject : BMW, Bell_Photography
Current IPTC Digest : 6249bf63f46e9abb15cfe27d71a87a72
Keywords : BMW, Bell_Photography
Originating Program : Shotwell
Program Version : 0.22.0
Image Width : 936
Image Height : 1334
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:4:4 (1 1)
Image Size : 936x1334
Megapixels : 1.2
Assuming that makes sense to anyone but me, is it possible?
.jpg
)? What program have you used to tag the images? Are the tags stored in EXIF inside each image file? Is there a single tag per image or there could be multiple tags?exiftool
, to make sure the tag info is present 3- Note: if some piece of information is necessary to answer the question then edit your question and put it there (don't put it in the comments)exiftool example.jpg
orexiv2 example.jpg
commands. Mention where tags in the output are.