Attempting to get a complete record list of all Gallery items.
medaughs
Joined: 2009-03-31
Posts: 5 |
![]() |
We have done a Sql query against the Gallery database but the record return is 5000+ greater than the number of actual images on the filesystem. We are trying to get a clean export of the database that matches the images on disk. Does anyone know of a Gallery feature or module that can do this? Thanks |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
Why not do a DB dump? The query is probably returning the resized versions along with the thumbs. If you go to Site Admin > Maintenance run the System Info task you can post those details and we'll be able to better give you an idea of how many items, albums, users, etc that Gallery thinks there are. You could also do a directory listing of g2data/albums that would contain all of the original, untouched images in their directory structure. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
So what kind of output are you looking for? -s |
|
medaughs
Joined: 2009-03-31
Posts: 5 |
![]() |
The resized version is starting to look along what we are thinking as well. A directory listing of the albums shows us about 18000 actual files while the database query returns about 23000 records. We are trying to pull all metadata with all record info for a special year end project report. The maintenance system info (minus proprietary naming info) is below: Gallery version = 2.3 core 1.3.0 |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
Quote:
We have done a Sql query Post your query - it should be a trivial one-line query to get what you want, maybe you've made a simple error? |
|
medaughs
Joined: 2009-03-31
Posts: 5 |
![]() |
We used a php script which is below: function fixQuotes($string) ***Relevant proprietary info removed**** mysql_connect($host,$username,$password); $query= # echo "Query: $query\n"; $result=mysql_query($query); $num=mysql_numrows($result); $i=0; $path=""; $parentid=mysql_result($result,$i,"g2_ChildEntity.g_parentId"); # echo "PROJ query:$proj_query\n"; $path = mysql_result($proj_result,0,"g2_FileSystemEntity.g_pathC omponent") . "/$path"; $parentid=mysql_result($proj_result,0,"g2_ChildEntity.g_parentId "); } $title=fixQuotes(mysql_result($result,$i,"g2_Item.g_title")); $description=fixQuotes(mysql_result($result,$i,"g2_Item.g_description")) ; $summary=fixQuotes(mysql_result($result,$i,"g2_Item.g_summary")); $keywords=fixQuotes(mysql_result($result,$i,"g2_Item.g_keywords")); $createDate=mysql_result($result,$i,"g2_Item.g_originationTimestamp"); $convertedDate=date('Y-m-d h:i:s',$createDate); $owner=mysql_result($result,$i,"g2_User.g_fullName"); echo "$id~~$filename~~$path$filename~~$projectName~~$title~~$description ~~$summary~~$keywords~~$convertedDate~~$owner~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ #%#%#%"; $i++; |
|
alecmyers
Joined: 2006-08-01
Posts: 4342 |
![]() |
OK, that's not very helpful. Let me think a bit. Right - I'm going to stick my neck out and say that your file estimate is wrong, and that the query is (correctly) returning the right items in your database. If you disagree, see if you can find out which items returned by the query are duplicates or otherwise shouldn't be returned. Resizes are GalleryEntities but not GalleryItems nor GalleryFilesystemEntities so I don't see that they would affect your search. |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
You know I already have scripts capable of recursive display. -s |
|