Names to ids

Chris Devers cdevers at pobox.com
Wed Jan 25 15:46:01 GMT 2006


On Wed, 25 Jan 2006, Andy Armstrong wrote:

> On 25 Jan 2006, at 15:10, Simon Wistow wrote:
> > But this means that we need to have a consistent filename to integer 
> > mapping so that it remains consistent between runs. This means that 
> > collisions should be kept to an absolute minimum because if a 
> > totally black image's filename gets mapped to id 88888 and then a 
> > totally white image's filename gets mapped to the same then we're 
> > going to get very bogus results.
> 
> Well MD5 won't collide too often. But shouldn't you be storing the 
> images (or at least whatever metadata is associated with them) in a 
> database and using the primary key as the ID?
 
Or store the metadata in the DB, leave the image files in the filesystem 
as is, and use the full path as the primary key ID.

If the full paths are unique, isn't that good enough? Do they *have* to 
be numbers? If they do, then maybe just assign sequential database IDs 
to each image as its information is loaded into said database, and use 
those (arbitrary, but so what?) IDs as fodder for Image::Seek. 

Would that work? Or is getting a DB involved overkill?


-- 
Chris Devers
DO NOT LEAVE IT IS NOT REAL


More information about the london.pm mailing list