Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Changing thumbnail naming convention  (Read 5818 times)

0 Members and 1 Guest are viewing this topic.

tuxhedoh

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
    • http://deanmckenzie.org
Changing thumbnail naming convention
« on: November 10, 2003, 07:45:17 pm »

I know that it's possible  to change  the prefix for thumbnails, but is it possible to have a suffix instead of a prefix.... i'm currently using Slooze, and it knows it's thumbnails by filename-t.jpg and I've already got a ton of pictures named that way.... does anyone  have any ideas.  I've got shell access to my host, so if anyone knows an easy way to rename a ton of pictures from filename-t.jpg to thumb_filename.jpg without much hassle I'd be more than interested... especially if that will be easier than modifing the coppermine code.

**[size=9]I realize this  is in the wrong forum... sorry. A mod feel free to move it.[/size]
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Changing thumbnail naming convention
« Reply #1 on: November 10, 2003, 09:00:11 pm »

I don't have a script ready to copy'n paste, but I'd have a look at the searchnew.php that comes with coppermine: it's normally used to go through all subfolders of the album folder to "hunt" for files that aren't in the database already (batch-add function); it should be fairly easy to modify it to run through the folders renaming files that match to a regex expression, of even easier: delete all thumbs instead of renaming them and let the utility "util.php" ("resize pictures" in the admin menu) batch-create all thumbs anew.

GauGau
Logged

libelle

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 11
    • http://www.fogbound.net
Re: Changing thumbnail naming convention
« Reply #2 on: November 12, 2003, 07:30:41 am »

Quote from: "tuxhedoh"
I know that it's possible  to change  the prefix for thumbnails, but is it possible to have a suffix instead of a prefix.... i'm currently using Slooze, and it knows it's thumbnails by filename-t.jpg and I've already got a ton of pictures named that way.... does anyone  have any ideas.  I've got shell access to my host, so if anyone knows an easy way to rename a ton of pictures from filename-t.jpg to thumb_filename.jpg without much hassle I'd be more than interested... especially if that will be easier than modifing the coppermine code.

**[size=9]I realize this  is in the wrong forum... sorry. A mod feel free to move it.[/size]


Well, the Unix shell has Mighty Power. If your shell is bash (which most Linux systems default to), you can do the following:

Code: [Select]

for i in filespec*.jpg; do mv $i thumb_${i/-t/}; done


If your shell is cshell, tcshell, kshell, zshell, or one of the many others, you should be able to temporarily switch over to bash by typing
Code: [Select]
/bin/bash
Then use the commands listed above.

WARNING: Renaming files can delete them in Unix if they clobber each other's names! A typo in the above command could be disastrous!  I have tested this on my own machine, but if your version of bash is different, it may behave differently! Back up your directory before using this command! I take no responsibility for lost files!

Good luck!
Logged
--
SjG

libelle

  • Contributor
  • Coppermine newbie
  • ***
  • Offline Offline
  • Posts: 11
    • http://www.fogbound.net
Re: Changing thumbnail naming convention
« Reply #3 on: November 12, 2003, 07:33:20 am »

In the above example, make sure to replace "filespec*.jpg" in the code with something that will actually match your filenames.

For example, if you're renaming from "picture0000-t.jpg" to "thumb_picture0000.jpg" use "picture*.jpg"

If this is confusing, let me know and I can clarify further.
Logged
--
SjG

Oasis

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 252
  • iNSiGNiA
    • Pixnet Gallery
Changing thumbnail naming convention
« Reply #4 on: November 15, 2003, 09:33:44 am »

POST DELETED..
Logged
Pixnet Gallery: http://www.pixnet.net
iNSiGNiA Weblog: http://www.jayliu.org
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.