TODO Notes 27 June 2007 ------------ Due to the design of the metadata import process which identifies images by their filename (with extension removed), there is a requirement to have a UNIQUE constraint on the image.image_filename. This is potentially a significant limitation, where all images must have a unique file name and can cause issues especially with camera-generated filenames where the chance of a collision would be particularly high. A solution to this could be to introduce automatic file naming - for example if a filename is already in use, it will have a number (or a random id) appended to the end. Using metadata, it could be possible to store the original filename: this tag is probably desirable anyway because the file extensions have already been chopped off. If output from exiftool is processed via process-metadata.php, this information would be stored already but we cannot make that assumption. A basic set of metadata should be added when an image is added to the database using process-filelist.php or another means. If an automatic id is used, there must be a way to determine which id to use next, preferably without requiring another database table but still able to differentiate between numbers in the filename and numbers added because of a filename clash. Useful tags: - original file name - import date and time --> how do we want to store this? UNIX timestamps are simple, but the meta value column is a text column and the timestamps aren't very user friendly Summary: [high] Write metadata containing original filename, import date/time when a file is imported [low] If filename collision occurs, append a counter or random id to filename