Seperate Filename & extension of files

EmmetMoore

Joined: 2009-07-24
Posts: 11
Posted: Sun, 2010-12-19 12:01


Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.2.9 cgi-fcgi
Webserver = Apache/2.2.11 (Unix)
Database = mysqli 5.0.83-community, lock.system=flock
Toolkits = Exif, Getid3, LinkItemToolkit, Thumbnail, ImageMagick
Acceleration = none/0, none/0
Operating system = Linux pemlinweb63.xxxxxxx.com 2.6.18-028stab070.10 #1 SMP Thu Oct 21 13:44:25 MSD 2010 x86_64

Hi,

I am trying to standardise the way the images are named when uploaded to my site. I understand that G2 will automatically rename a file to "filename_001.extension" if another file of the same name exists. What I'm trying to do is force every file to be named the same, so that G2 be forced to auto rename the files.

I believe I have found where the naming of the file takes place (gallery2/modules/core/ItemAddFromBrowser.inc). Currently any changes I make to the code also strips out the extension of the file name - so what is uploaded is "filename" instead of "filename.jpg", & as a result the file is not processed properly.

Can anyone advise as to how I can force the same filename each time - without affecting the extension?

Thanks in advance,

Emmet