views:

13

answers:

0

I'm writing a plug-in for another program in C#.net that acts as a catalog creation and search tool for custom content we've created at my office.

An administrator will picks a root catalog folder, and the app will then parses through all the subdirectories looking for specific file types. Then it generates a Catalog by saving the relative path to the files from the root folder, the properties of the file, and thumbnail preview images.

A file will be able to be uniquely identified by the relative path to it from the root folder. So later an admin may re-scan a catalog root folder to look for new or missing files or update modified files in the catalog.

Finally users will use the plug-in to search and filter content in the catalog, view the preview image, and load the company content into their current project.

Right now I'm saving the catalog data to XML because I'm comfortable with XMLSerializer, but later I'll probably try something like SQLLite. I do not want this to require any kind of database server like SQL Server or MySQL, as users may even want to use it to generate a search-able catalog of a folder on their local computer.

What I'm trying to figure now is the best way to track and store the preview images. Like I said before I'm uniquely identifying a file by it's relative path from the root folder, so there should be a way to derive the location of a preview images given any valid relative path. I thought about just storing the preview image in the same location as the source file but with a JPG extension, but I'd rather not muck up these folders with random image files everywhere. Alternatively, I could store the images at the same relative path, but in a separate (possibly hidden) sub-directory off of the root folder. See the example below.

Root folder: C:\My Catalog\
File 1: C:\My Catalog\foo\bar\file1.xyz
File 2: C:\My Catalog\blah\blah\file2.xyz
File 1 Preview: C:\My Catalog\.previewImages\foo\bar\file1.jpg
File 2 Preview: C:\My Catalog\.previewImages\blah\blah\file1.jpg

Is there some other method of storing and retrieving these preview images? Would there be some advantage of storing the images directly in a database rather then tracking them by file and folder names? I'm curious how others would approach this problem.