Advanced search  


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.

Pages: [1]   Go Down

Author Topic: Coppermine vs 5,000 image collection  (Read 3527 times)

0 Members and 1 Guest are viewing this topic.


  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Coppermine vs 5,000 image collection
« on: August 16, 2004, 12:14:29 am »

I have installed (and reinstalled) Coppermine a few times and have fed it all sorts of images & movies without any problem at all. Rather robust application and I plan to grow rather intimate with it.  But I am having a human logic problem trying to import about 5,000 images into Coppermine in a structured fashion and wondered if someone might help me better define an approach for this who understands the app.  Wrangling this 2+ gig mass of images is cumbersome and slow, so trail-n-error on a large scale will take me months.

The images were delivered to us in one folder from a W2K server, which then contains about 350 nested folders.  Some of those folders include nested sets themselves, sometimes going 5-8 folders down.  Many folder (and image) names contain spaces, ampersands, etc.  Some folders contain only 1-2 images, others contain hundreds.  There are everything from PDFs through MOV and QT files in the collection, but mostly JPEG and GIF files.  I can beat the file/folder naming problems with a small Perl script. I think.  

But to the collection creator each nested folder represents a Coppermine category in one big album.  And folders nested under each category are sub-categories themselves.

Here's where my logic challenge begins to come in.  I've been manipulating the collection on a Win server in order (among other things) to inject ITPC fields into each image.  Coppermine (using the ITPC mod I saw here in the forum) eats the newly inserted ITPC fields without any problem at all, which is great.  And since I can auto-add the folder name as an ITPC keyword or 'category', I thought there might be a way to use them as category names in Coppermine.  Doesn't look that way.  So I need some help.

How in the heck should I be approaching this?  I'm considering a SQL script to just import all the folder names as categories and parented subcategories, then (gag) manually importing all images for each in small batches.  Lots of small batches.

Could anyone suggest a better approach for this?  Core issue one is using the folder names as categories - at the time of import if possible.

Any help or perspectives would be appreciated.



Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
Re: Coppermine vs 5,000 image collection
« Reply #1 on: August 16, 2004, 09:07:36 am »

Best approach would be imo to create a modified version of searchnew.php (name it searchnew2.php or whatever) and modify it to have mySQL statements that create categories and albums as it goes through the folders. Main issue here is how the script is meant to determine wether an category or album should be created, as only albums can hold files, categories can't. That's why I'd use the approach to create a category for each folder that is being found as well as an album. In another step you could then add the pics to the albums they're in and later delete all categories and albums that remained empty (after the import process is over).

Nobody has come up with a request like yours, so there's no actual code I could post. If you're comfortable with php and mySQL, you should be able to come up with this sort of hack, but if you're not I'm afraid it will be easier to create the cat/alb structure mannually and batch-add "the regular way", sorry.

« Last Edit: August 17, 2004, 09:14:21 am by GauGau »


  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Coppermine vs 5,000 image collection
« Reply #2 on: August 16, 2004, 08:33:09 pm »

Thanks GauGau, your opinions are always educational and helpful.

I wrangled about 400 of if the images into place last night trying to set a pattern to replicate via code.  Still an ugly layout, but you can see the objective at  Its all a sailling image database for America's #1 'Around Alone' sailor who is leaving in a few months to do it again.  I offer the link because I got an off-list message (got a few actually) which seemed to think it was a porn database for some reason.  Guess that's not too far from the truth; sailing is pure porn to me (smile).  I see a full sail and get a stiffy.

I follow what you mean and do not see the coding to be a dramatic problem.  I'll start script snipping tonight and share the results in the forum.  I'm not a real fan of PHP but its sure as hell easier than Perl-ing it.

The biggest initial problem was purely psychological; my mind refuses to accept the proper definitions for an "album" vs a "category".  They are reversed in my brain.  I could not shake the perspective until I manually fed it the 400 images. Now its kinda clear heh...  Looks like I'll end up with maybe 10+ main categories, but some will contain 100 and some 2000 items.  So if I can't script it, I'm doomed.

Thanks again.

Pages: [1]   Go Up

Page created in 0.016 seconds with 19 queries.