When a camera creates images on the memory card inserted in the camera the image file name will normally conform to the DCIM (Digital Camera IMages) standard. As part of the standard it will create a number sequence between image files. This will make the image file names on the memory card unique. However each time a new empty memory card is inserted then the number sequence will restart. This will give rise to an image file name clash problem.

Image file name clash problem

When images are imported into the archive image file names may be the same. If the image file has the same file name as a previously imported image taken on the same day it will over-write the previous one.

For example, each time the memory card is used the first image file name will be DSC0000001.jpg. So there will always be a file name of DSC0000001.jpg each time the card is re-used.

If you use the same card on the same day the archive as the names are the same over-write the first DSC0000001.jpg

ImgArchive prevents this from happening by spotting the clash and re-naming the second instance of the same name.

Standard DAM Practice

One of the standard DAM practice is to rename image file name so they are unique to at least the archive.

This is for the following good reasons:

  • Stops the image file name clash problem

  • guarantees there is no chance of over-writing by accident.

  • there is no ambiguity between images

DAM defines a list of attributes a generated file name should contain:

  • Each image file should be unique in the archive

  • Each image file should have a file extension denoting its image type

  • Have a maximum length of no more than 31 characters.

  • Section delimiters should only be underscores and dashes

  • The name format should be maintained thought-out the archive

ImgArchive supports this practice as a way of maintaining consistency of work flows throughout the archive. For example ImgArchive will expect image file names in a known format when carrying out operations on image files such as generating new versions.

Creating Unique Names

Unique names must be unique within the archive. Note: creating truly unique names is possible but unwieldy so not used in this case.

Using Sequence numbers

ImgArchive generates a sequence number for each image in the archive using this number will guarantee the number will be unique. This is 32 bit in size so is able to store 4,294,967,295 images.

Number bases

In order to store the maximum sequence number in decimal takes 10 characters. the number of characters to store the maximum number using common number bases are shown below:

Number base

number of chars

Example

Base10 (Decimal)

10

4,294,967,295

Base 16 (Hex)

8

D6854FFA

Base 32

7

AGGHS44

Base 64

6

AaCD+/

Base 64 is the shortest but only by one character, base 32 and base 16 are easier to read but of manageable size. The version of base 32 used by ImgArchive has no characters that look the same, the character zero and one have been removed so base 32 has been picked for creating a unique name based on a sequence number alone.

An example of an image file with original name, the sequence number and version is shown below:

DSC0002348-AGGHS44[14].JPG

Using Date

Using the date can be used however, date can not be used alone as more than one image can be take in the same time frame even down to a second. Two images can be taken at the same second by two camera’s it is unlikely but possible. An easier solution would be in combine the date with short sequence number.

There are two options on the date format, one is a man readable format such as:

YYYYMMDD i.e. 20120704

Or the second is a pure number of days taken from a date in the past. A good candidate would be the number of days since civil. That date is 1970 01 01.If using base 32, a four character number would give 1048576 days about 2800 years. A short short sequence number may be three base32 characters giving a maximum sequence number of 32768. That would be 32768 images can be taken a day without repeating the same number.

An example of an image file with original name, the date + short sequence number and version is shown below:

DSC0002348-20120704AGG[14].JPG

An example of an image file with original name, the date sequence + short sequence number and version is shown below:

DSC0002348-AZD1AGG[14].JPG

No Rename Sequence

This sequence is used if you want to keep your original image file name but ImgArchive will add a short sequence to stop any name clashes.

An example of an image file with original name plus short sequence number and version is shown below:

DSC0002348-1[14].JPG

Handling Image Pairs

If there are more than one image of the same shot then both of the images will be renamed the same. For example Nikon and Cannon provide RAW + jpg for each shot taken, Image Archive will make sure both are stored together with the same name but different extensions (.NEF and JPG). however the sequence will be consecutive. Having different sequence numbers will stop one over-writing the other if the extensions are changed and clash. These extensions will be maintained as the originals in order to ensure greater compatibility.

Selecting a Rename Option

Selecting an option is a General option. This can be set using the iaadmin config --general rename=<option>

Syntax:

iaadmin config general file-rename=<pre-name>{<type-base>}[<version-base>]

pre-name:

This is predetermined text that can be inserted at the beginning of the image file for example:

iaadmin config general file-rename=IAF{sequence-base16}[base10]

IAF0000785F[07].jpg

type-base:

This option will determine which sequence type and numeric base will be used.

The sub type options are:

Sequence - Uses the ImgArchives image sequence. This is guaranteed to be unique within the archive.

Date - This uses the number of days from 1970-01-01 plus a short sequence.

ReadableDate - This uses a readable date format plus a short sequence.

NoRename - This does not rename the image file but may append a short sequence to avoid name clashes.

number base:

All of the above options may use a numeric sequence the number base is determined by this option.

The number base can be one of the following:

Base32 - Base 32

Base16 - Base 16 or hexadecimal

Base10 - Base 10 or decimal

Version-base:

When new versions are created the version number will be incremented.This number can be base 32, 16 or 10.

The number base option can be one of the following:

Base32 - Base 32

Base16 - Base 16 or hexadecimal

Base10 - Base 10 or decimal

Examples:

The Syntax of the command is:

iaadmin config general file-rename=<pre-name>{<type-base>}[<version-base>]

Sequence option

iaadmin config general file-rename=JohnLewis{sequence-base32}[base10]

JohnLewisAAA785F[07].jpg

Date option

iaadmin config general file-rename=John.Lewis-{date-base32}[base10]

John.Lewis-AAF5AAD[45].jpg

Readable date option

iaadmin config general file-rename=John.Lewis-{readabledate-base32}[base10]

John.Lewis-20210723-85F[07].jpg

Year: 2021

Month: 07

Day: 23

No Rename Option

iaadmin config general file-rename=John.Lewis-{norename-base32}[base10]

DSC0004538-F[07].jpg

Note: The original image file name was:

DSC0004538.jpg

There was 16 identical image file names that would have clashes