Is it possible to edit pictures titles and descriptions in batch? Is it possible to edit pictures titles and descriptions in batch?
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Is it possible to edit pictures titles and descriptions in batch?

Started by Fab, September 04, 2006, 11:13:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fab

I have to add titles and descritions to close to a thousand pictures, a lot of them will have the same title and description.

Is it possible to edit the pictures titles and descriptions in batch? maybe with a plugin or straight from a file.

ralfs

Hi.

In your case I would go the direct way:
Run phpmyadmin, take your database.
Then 'SQL' and enter

Update cpg_pictures
  SET title = x
  WHERE aid = y

Regards,
Ralf

Fab

Thanks Ralf, but I need some clarification.

Let say I want to set title to "RED" for  pictures named redpic001 to redpic150

What should I type?

And can I use the same method for keywords?

ralfs

Hmm,

Ok, there might be special SQL terms where these things could be done, but I don't know much more than the 'standard command calls' in SQL.
You could try regular expressions in your SQL query:

Update cpg_pictures
  SET title = 'x'
  WHERE filename REGEXP 'xyz'

Without trying it, I think, in your special case REGEXP '^redpic[0-1][0-5][0-9]' would output 'redpic000.jpg' to 'redpic159.jpg'
So you could have a deeper look into SQL syntax, regular expressions & co. or you try something totally different:

Create a new temporary album. Move all pictures, which have something in common such as title, to that album. After batch update via SQL, as I described in my first answer, you can move them back where they came from.

It doesn't matter, what you do: you have to address exactly these files, you want to change. Be it via a special REGEXP in an SQL call or be it by placing all relevant pictures in a temporary album (where aid = xyz).

And: Of course, you can use any field in your table, also the keywords field:
Update cpg_pictures
   SET title = 'x'
   WHERE keywords REGEXP 'xyz'

Regards,
Ralf


Joachim Müller

Be extra carefull when messing with the database in phpMyAdmin. Make sure to backup everything before trying, as  there's a great danger of ruining your entire site running a query that gies wrong.

Fab

Quote from: GauGau on September 05, 2006, 03:18:00 AM
Be extra carefull when messing with the database in phpMyAdmin. Make sure to backup everything before trying, as  there's a great danger of ruining your entire site running a query that gies wrong.

Yes I know, I think I will install another gallery to experiment.

Before I try this are there any other alternatives to batch edit titles?