[ansel] Store images with extension?
Chuck Hagenbuch
chuck at horde.org
Tue Sep 7 14:01:52 PDT 2004
Quoting Alan Garrison <alang at cronosys.com>:
> Just a thought, how about something like this:
> (file md5sum)_(original filename)
> e.g.,
> 2c7f55d3aae7037c094b116d7b257b89_image2.jpg
>
> Or perhaps
> (uploader user-id)_(file md5sum)_(original filename)
> e.g.,
> joebob_2c7f55d3aae7037c094b116d7b257b89_image2.jpg
>
> or even
> (uploader user_id)_(upload timestamp)_(original filename)
> e.g.,
> joebob_10298309230_image2.jpg
Prone to race conditions. In extreme cases, yes, but still worse than the
current hash.
> md5'ing the file may be useful if you are looking for the same exact
> image with possibly a different name, though some may consider this too
> much overhead. The user+timestamp+name should probably negate any
> chance of a dupe name, should be trivial to calculate on the fly, and it
> still keeps the basic filename structure (just tacking on stuff to the
> front). Of course you'll have to properly escape the user id and filename.
These are all very long, introduce the escaping issue you mentioned above, and
also I'm not sure why any of them are better than the current hashing method,
which has the advantage of storing by image id? I guess I see that they
let you
include the original image name, but a lot of other stuff too. And then if you
edit the image, would you change the md5? And thus update it everywhere? Or
would you leave it calculated from data that no longer exists?
-chuck
--
"Regard my poor demoralized mule!" - Juan Valdez
More information about the ansel
mailing list