Managing a photographic archive

File naming conventions for photo archives

Patterned dark chocolates arranged in an open oval wooden box.
Chocolates in an oval wooden box.Photograph by Robert Harper. Robert Harper Photograph Library, Archive.London. From the archive, shown for illustration.

A file name has one job in an archive: to identify one file, permanently, on any system. Descriptions belong in the catalogue and the metadata, where they can be corrected without renaming anything.

A digital camera that numbers its files from 0001 to 9999 starts again at 0001 on the ten-thousandth frame. Any photographer who has worked for more than a few years therefore owns many different pictures called DSC_0421, and an archive that relies on camera names will sooner or later overwrite one with another. That single fact explains most of what a file naming convention is for. In an archive, a name must identify one file and only one, for good.

The rest of the convention follows from four requirements. A name should be unique across the whole archive, permanent once assigned, portable across Windows, macOS, Linux, cloud storage and the web, and sortable, so that a directory listing falls into a sensible order without help.

What makes a good file name for an archive?

Think of the file name as a shelf mark and not as a caption. A shelf mark tells you where a thing belongs and distinguishes it from its neighbours. It does not try to say what the thing is about.

That runs against instinct. A name like red_shoes_studio_1994_best.jpg feels helpful, but it fails in four ways: it embeds a description that may be wrong, it will need changing when the description is corrected, it cannot be generated by rule for the next 50,000 files, and "best" is an opinion. The catalogue is the right place for all of that, along with the embedded caption and keywords described in the guide to IPTC photo metadata fields. A catalogue entry can be edited a hundred times while the file name it points to stays put.

What rules should a naming convention follow?

Published guidance from archives is consistent. The State Archives of North Carolina, whose advice is widely borrowed, puts consistency first and then sets out a handful of rules that apply to photographs as well as documents.

Rule Do Avoid
Characters Letters, numbers, hyphens, underscores Spaces; slashes, colons, asterisks, brackets, ampersands and other symbols
Full stops One, before the extension Full stops inside the name
Case Lower case throughout Mixed case that differs only by capitals
Length Short: about 25 to 30 characters is usually enough Long descriptive phrases
Dates ISO 8601, year first: 20081105 or 2008_11_05 5-11-08, Nov5, 05112008
Numbers Fixed width with leading zeros: 0001, 0002 1, 2, 10, which sort as 1, 10, 2
Versions A defined code or v01, v02 "final", "final2", "new"

The table combines North Carolina's rules on characters, spaces, length, dates and versions with two conventions that are standard practice in digitisation: lower case, because some systems treat Photo.TIF and photo.tif as different files and others do not, and fixed-width numbering, because computers compare names one character at a time.

Spaces deserve a particular mention. They are legal on modern desktops, but they turn into %20 in web addresses and cause trouble in scripts. An archive whose files will one day be served from a website or processed in bulk is better off without them.

How should scanned film be named?

For film, the name should be built from the catalogue. If the folder-level inventory gives every folder a reference, each scan inherits it and adds a frame number:

arc_0217_0042_m.tif

Reading left to right: a collection prefix, the folder number, the frame number within that folder, and a one-letter role code. The prefix, numbers and codes here are an illustration of a pattern, not the scheme of any particular archive.

Element Example Purpose
Collection prefix arc Keeps files identifiable if they leave the archive
Folder reference 0217 Ties the file to the physical folder and its catalogue record
Frame sequence 0042 Unique within the folder; padded to four digits
Role code m m for master, a for access copy, and so on
Extension .tif Set by the format, never typed by hand

Three practical points follow. Decide the frame order before scanning and keep to it, usually the order of the sleeves as found. Scan the mount or sleeve annotations as well as the image where they carry information, and give those files a suffix of their own. And keep the master and its derivatives under the same base name, so that arc_0217_0042_m.tif and arc_0217_0042_a.jpg are visibly the same photograph. Which formats those masters and derivatives should be is a separate decision, covered in the comparison of TIFF, DNG and JPEG 2000.

How should born-digital files be named?

Born-digital files arrive with names already. There are two defensible approaches.

Keep the camera name and make the path unique. Leave DSC_0421.NEF alone and rely on a dated folder structure to separate it from the other files of the same name. This is the least work and preserves the original exactly, but the file loses its identity the moment it is copied out of its folder.

Rename by rule and keep the original. Give each file an archive name and carry the camera name along as a suffix or in a catalogue column: arc_d0312_0421_dsc0421.nef. This costs a little length and buys uniqueness everywhere.

Either way, the date a photograph was taken is better read from the file's metadata than typed into its name. The camera records it in EXIF, and the EXIF viewer will show it. A date in a file name is a convenience for sorting; the embedded date is the evidence.

Whichever approach you take, a renamed file is still the same file. Its content, and therefore its checksum, does not change when the name does. That is the reason to record a SHA-256 value for every master: the Digital Preservation Coalition describes a checksum as a digital fingerprint, and it lets you prove that arc_d0312_0421.nef is bit for bit the file that left the camera as DSC_0421.NEF. The image hash generator produces one in the browser.

How do you rename thousands of files safely?

  1. Write the convention down on one page, with examples and the meaning of every code, and store that page with the archive.
  2. Work on a copy. Never run a first batch on the only set of files.
  3. Rename by batch, by rule. A tool should apply the pattern; a person should not type names. The bulk rename tool applies a prefix, a starting number and zero padding to a set of files, can keep the original name as a suffix, and leaves each file's bytes and metadata untouched.
  4. Keep a mapping. A two-column list of old name and new name is the audit trail. Save it as a CSV file beside the images.
  5. Verify. Compare checksums before and after. If they match, only the names have changed.
  6. Then stop renaming. Once a name has been published in a catalogue, cited or sent to a client, it is fixed.

What this looks like in one archive

The Robert Harper Photograph Library is at the stage where these decisions carry weight. Its published inventory lists 503 folders. The digital side is held as Nikon NEF raw files, TIFFs and JPEGs. The film, mainly 6 x 7 colour transparency and browsable by format in the analogue collection, is largely unscanned. By the inventory's own count, to which its 503 lines add up exactly but which has not been checked frame by frame against the physical material, there are 177,143 frames including duplicates and variants. Every scan made from now on needs a name that leads back to one of those 503 folders.

Scanning and cataloguing companies who work to a documented naming scheme, and would like to see the inventory they would be naming against, are invited to get in touch through the digitisation partners page.

Frequently asked questions

What is the best file naming convention for scanned photographs?

Use the catalogue reference for the folder, a zero-padded frame number and, if needed, a short code for the type of file: for example arc_0217_0042_m.tif for the master scan of frame 42 in folder 217. Lower case, no spaces, only letters, numbers, underscores and hyphens, and a single full stop before the extension.

Should I put descriptions or keywords in file names?

No. Descriptions change as research improves, and a renamed file breaks every link, citation and catalogue entry that pointed to it. Put captions, names, places and keywords in the catalogue and in embedded IPTC metadata. The file name should be an identifier that never needs to change, even when the description is corrected.

Which characters should I avoid in file names?

Avoid spaces and anything other than letters, numbers, hyphens and underscores. Slashes, colons, asterisks, question marks, quotation marks, angle brackets, ampersands and similar symbols are reserved or awkward on at least one common system, and spaces become %20 in web addresses. Use one full stop only, before the file extension.

Should I rename the raw files that came out of the camera?

You can, if you do it once, by rule, and keep a record. Camera names such as DSC_0421.NEF come round again after 9,999 frames, so they are not unique across an archive. Rename to your scheme, and keep the original name as a suffix or in a catalogue column. Never rename master files by hand, one at a time.

How many digits should a sequence number have?

Enough for the largest set you will ever have, plus a margin. Four digits covers 9,999 frames in a folder; an archive-wide running number for 100,000 or more items needs six. Fix the width at the start and pad with leading zeros, because computers sort names character by character.

Sources

Published by Archive.London. Corrections are welcome under our editorial policy.

Help digitise the archive

52,684 analogue originals, mostly medium-format transparencies, are waiting to be scanned and catalogued. We are speaking to scanning, cataloguing and tagging partners.

See the digitisation briefWrite to the archive