[ansel] Proposed patch

Heath S. Hendrickson heath at outerspaceconsultants.com
Mon May 10 12:33:45 PDT 2004


Chuck Hagenbuch wrote:

> Quoting "Heath S. Hendrickson" <heath at outerspaceconsultants.com>:
>
>> I'm going to write a patch to allow the admin to set wheter to store
>> files with their original filename or the md5(microtime)  version.
>
>
> I wouldn't recommend doing this; it'd prevent you from having 2 images 
> with the
> same name in *all of Ansel* - not just in one gallery.
>
> Better to change the VFS name of images (which will be localized to
> per-gallery), and warn if you're about to overwrite an existing image 
> (you'd
> have to know not to create a new datatree object in that case, 
> though), than to
> mess with the datatree end of this.
>
Sorry, I wasn't terribly clear.  That's what I was intending on doing.  
My initial look at the code lead me to believe that it was the 
addImage() function that set the VFS name, but that's not the case.  The 
filename is actually set in the writeData() function.  I'll just have to 
tract it through a little to know if just changing that will suffice of 
if I have to modify other code as well (i.e.,  does the VFS_direct 
option use the VFS filename as stored in the datatree driver or does it 
create it based on the same algorithm used for the writing 
($this->getId() . '_full').  You brought up a good point, though.  Since 
the datatree doesn't use the same name as the VFS filename, then it's 
not trivial to chang the VFS filename.  My main intent with this was to 
make it so that a user could re-upload an image (say they were editing 
and screwed something up) and not have to reenter any of the caption 
data or other info.

h


More information about the ansel mailing list