Initial Import

From Sea of Fate
Jump to navigationJump to search

Introduction

The initial Import for the Image Processing Application will be performed by a single application called photo Importer. The application will be written in traditional C, Mostly by Gemini AI but designed and edited by me. C has been chosen as I at least understand enough of it to know when it is being done badly.

Library functions

There will be a series of Libraries to do some of the operations. Most have been made in to SO files but the source code is also available.

Filename Creation Lib

The Library that creates the new filenames will have a single parameter of a number, in this case it will be the loop count. The function will take the parameter and do a mod((26 x 26)-1) and the convert the number to a base 26 number represented by lower case letters. By keeping it down to mod(26x26)-1 there should only ever be two letters. The next part of the filename will be the time stamp seconds also converted to base 26. To make the actual base filename we simply concatenate the two base 26 numbers. Using this system we should get unique base filenames as long as we don't process more than 675 (26 x 26 -1) files per second and it should also be reasonably short at 2 + 7=9 letters. We can use this as the basis for a filename.

Hash Creation

The Library to create a hash total will take the filepath + filename as it's parameter and will return the Md5 result.

File Ops Library

The file_ops lib will do a number of things related to files and filnames.

DB Ops Library

The DB_Ops library will have all of the functions related to creating database rows, searching rows and updating them.