Batch Rename script

jeremy
jeremy's picture

Joined: 2003-02-15
Posts: 49
Posted: Fri, 2004-12-24 18:40

Is there a way to rename picture files once they have been downloaded? Better yet, does anyone know of a batch rename script that could change the name of all of the pictures in a particular folder?

I am running on an older version of gallery. I tried searching but didn't have any luck. Either of these would be of great help. Thanks for your help.

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sat, 2004-12-25 00:13

You mean something to rename them once you have downloaded them from gallery -> your home computer?

Once they are in gallery, I don't think there is an easy way to re-name them. If you want them to have special names, they should have them when you upload them. If you had the "rename" option set to, all your files will be named like "aaa.jpg" or "aab.jpg" and there isn't much to be done about it.

 
jeremy
jeremy's picture

Joined: 2003-02-15
Posts: 49
Posted: Sat, 2004-12-25 03:28

Yes, I'm trying to rename pictures that are already loaded into my albums folder. There should be a way to create a rename picture script similar to the rename album script that currently exists in the album view. Once the script was created, i could just edit the view_album or view_photo code so that it would be available in the drop-down menu.

Does anyone have any ideas on the code needed for this type of script?

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sat, 2004-12-25 04:08

I spose its possible, but what would be the point? You can edit the title, description and summary... the file name is transparent to the end user, so why do you want to re-name it?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2004-12-25 04:16

<<admin options>> dropdown select; edit captions.

 
jeremy
jeremy's picture

Joined: 2003-02-15
Posts: 49
Posted: Sat, 2004-12-25 04:25

The filename appears in the url. For search engine purposes, I'd like to have more appropriate filenames.
E.g. instead of having a filename like 0234.jpg that has the url http://www.domain.com/gallery/0234

I'd like to have a filename like mona-lisa.jpg that has the url http://www.domain.com/gallery/mona-lisa

Since I already have hundreds of pictures uploaded, I'd like to be able to change the name instead of having to upload them all again.

 
fryfrog

Joined: 2002-10-30
Posts: 3236
Posted: Sat, 2004-12-25 05:01

Well, I have not ever seen a request like this before or a script / modification that would do it... so it looks like you would have to write this yourself. I believe it would involve modifying the .dat files as well as the actual file name. Of course, you would have to modify the .thumb. , .sized. and .highlight. image names as well.

I do believe that most search engines base their results more on the descriptions near/around the images than from their names. My gallery auto-renames all files to the "aaa" standard and I get plenty of hits from people searching for and finding images where the only description available was in the title / description of the sub-album itself.

Do you know which search engines have a strong need of a useful filename to be indexed?

Also, good luck with the script :)

 
jeremy
jeremy's picture

Joined: 2003-02-15
Posts: 49
Posted: Sat, 2004-12-25 05:21
Quote:
Do you know which search engines have a strong need of a useful filename to be indexed?

Most search engines give significance to url structure. You will be indexed either way, but to have better serps, filename/structure and important. I get the feeling that the rename script may be a daunting task. I was hoping to make the changes to improve my ranking in the yahoo and google image searches. I'll just concentrate on other optimization if the rename function is this troublesome.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2004-12-25 05:34
jeremy wrote:
I get the feeling that the rename script may be a daunting task.

I think it would be a big task. Even from a UI point of view.....You would have to have a thumb of the old image and its filename then beside or below have a form entry for the new filename.
Then as fryfrog said you would have to copy the original, thumb and resized images rebuild the album.dat file and then delete the old files.
All this while preventing other users from doing things to the album at the same time or you WILL get a corrupt .dat file.

The user would still have to type in the name of the file so I doubt that it would save a significant amount of time over re-adding the images with the proper name.

Dave

 
jeremy
jeremy's picture

Joined: 2003-02-15
Posts: 49
Posted: Sat, 2004-12-25 05:40

Thanks guys for your input. I also thought about using mod rewrite to change the url to reflect the caption instead of the filename. That is probably a much easier solution. Any ideas on where I would change the mod rewrite code.

 
toastmaster

Joined: 2003-05-01
Posts: 219
Posted: Sun, 2005-03-13 07:50

Did anyone get anywhere with this? I've got about 120 images that really need renaming from PICT0105 etc, to something more meaningful for the search engines.
Thanks!

 
EverythingEverywhere
EverythingEverywhere's picture

Joined: 2008-04-25
Posts: 3
Posted: Sat, 2008-04-26 00:42

I think SEO is currently the weakest part of Gallery. I did a big import from Flickr and all my flies are gibberish. I'd be happy with a way to make the title of a photo the image name, with - replacing spaces.