Forum Moderators: coopster
[edited by: jatar_k at 5:27 pm (utc) on June 2, 2004]
[edit reason] removed email [/edit]
Here's a simple attempt:
<?php
$imagearray = glob("/path/{*.jpg,*.gif,*.png}", GLOB_BRACE);
foreach ($imagearray as $filename) {
$query="INSERT into table ('imageURL') VALUES ('".$filename."')";
$result=mysql_query($query);
}
?>
I'd use glob() to get all the image URLs and throw them into a database.
Then I'd walk through the database and use getimagesize() to find the height and width for each.
The really hard part of your project will be entering all those searchable keywords appropriate for each cover... For instance I presume that an ABBA cover might be found if I searched for "ABBA", "Bjorn", "Dancing Queen", "Super Trooper"
Maybe you'll need a more robust data architecture that includes tables or columns for
"album",
"song_title",
"artists",
"covers",
"publishers",
"date"
etc.
You'd need a system of cross-references between each, and entering the data would take a long time. But then once the info is entered, the whole thing would be searchable in many ways with a lot of flexibility.
[url]launch.yahoo.com[/url] has that sort of thing for their discographies.
I think you've got a pretty ambitious project going on there. Good luck!
httpwebwtich you said this
Adding the image URL and the image dimensions to a database will be easy - those tasks can be automated using built-in PHP functions (provided you put them together in the right way).
I'd use glob() to get all the image URLs and throw them into a database.
do you have any scripts that will do exactly that.
the covers directory is http;//81.104.107.121/covers/
there are no other file types in these directories, just jpg files.
cheers