CyberiaPC.com Community Forums Main Page
RSS Feeds: Late(st) News | Zenith Picture Gallery | Most Recent Community Topics | Tips, Tricks and Other Useful Stuff

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Automatic folder structure detection, I'm desperate for this feature
Usher
post Apr 7 2008, 08:47 AM
Post #1


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




Hello!
I've been searching for a GOOD picture gallery program for ages now, and so far I've come up with a simple conclusion: Go basic, such as 'picy' and have real ease up updating, but no nice features; Go full out, such as 'Gallery2' and get way more than you need, and a slow slow slow bloated pos. At long last I think I have found the perfect middle-ground in Zenith, and am eager to implement it, but I have one HUGE problem that I refuse to waste hours of my life fixing: Uploading pictures.
Let me explain. I have tons of pictures in an already existant folder structure on my linux box, exactly in the sub categories i would want them in, and although most currently lack good names, I'm happy with where they are. When I installed Zenith, the only way to bring those pictures in, that i can find, is to use the 'batch upload', which requires I take them all out of their folder structure and recreate that same structure in categories, and reimport. End result: I will have all my files in their exact same folder organization, with the exact same names, but Zenith will know about them.....and I'll be 4 hours older and many shades more grey on top.
I attempted to create a few categories and put the pictures there manually to test, and the 'create thumbnails' functionality worked, but they never showed up in Zenith, I assume because they are not in the database. So what I need desperately is some functionality to have categories and subcategories automatically created, and files detected and added to the database, even if there is no special info like a description added by default. Otherwise I must go find some other solution, and I don't look forward to that.

Please please please help me out! You have an incredible piece of software here!

Thanks,

~Usher


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
usr.c
post Apr 7 2008, 09:59 PM
Post #2


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Hi, Thanks for the comments. I'll go ahead and write a script to do just that for you and hopefully have it ready before the weekend.

I'll keep you posted.


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
Usher
post Apr 8 2008, 12:44 AM
Post #3


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




Thanks SO much!
How can I donate? I want to make sure to support you, since this is such an awesome piece of code!


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
usr.c
post Apr 12 2008, 02:47 AM
Post #4


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Try this. Upload it to your main installation directory and run it from your browser. Then Run the "Rebuild Thumbnails" tool in the Admin CP to create your thumbnails.

Make sure
*All directories under uploads are readable
*You've already setup your gallery (the script uses variables from your config.php file)

Currently, it sets the keywords and title fields to the filename.

I didn't get a chance to test it on more than one of my test galleries, but it should be ok. If anything weird happens, let me know.
Attached File(s)
Attached File  automatic_file_structure_detector.php ( 5.36K ) Number of downloads: 86
 


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
Usher
post Apr 12 2008, 08:13 PM
Post #5


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




Two things,
When I run the script you made, it appears to work properly, but it makes duplicate entries of any categories that already exist. So categories such as 'Other' get added again, so that there are two 'Other' folders, and if I run the script again, it makes a third copy, etc...

Second, after runing the script, I ran the 'rebuild thumbnails' and this is what was output. I only put pictures in the 'Other' folder as a test.
Let me know how I can help out.

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in /var/www/unaliased/zenith/image_man.php on line 103

Warning: Cannot modify header information - headers already sent by (output started at /var/www/unaliased/zenith/image_man.php:103) in /var/www/unaliased/zenith/admincp.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /var/www/unaliased/zenith/image_man.php:103) in /var/www/unaliased/zenith/head.php on line 52
Powered by Zenith Picture Gallery


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
usr.c
post Apr 12 2008, 10:34 PM
Post #6


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Be sure to empty your pictures and categories table before running the script.

About the other issue, you've only got images in your directories right?


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post
Usher
post Apr 12 2008, 11:26 PM
Post #7


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




Thanks for the tip, clearing out that table worked well, but the thumbnail rebuild still isn't working. The only file other than .JPG's in that folder is the index.htm file, and everything is set to 777 just in case. I'll see what more I can do later today.

Thanks again


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
Usher
post Apr 13 2008, 01:48 AM
Post #8


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




I fixed it! 2 things were causing problems, one, I changed the thumbnail size, and after doing so, the recreate thumbnails worked. 2) My files ended with a *.JPG, renamed to *.jpg and it worked.

Thanks so much!


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
Usher
post Apr 20 2008, 02:20 PM
Post #9


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




Ok, so I've had some time here at work, and I think i've made a new and improved script that everyone can benefit from.
By default, the script will no longer make any changes to your database, if you add a '?execute=true' it will allow sql changes, if you add 'add=true' it will add pictures, and 'update=false' will disable what I call intelligent moved picture detection.

What I have added:
1. Error proofing
-Will not change anything if run by accident
-Will not create duplicate categories
-Will not create duplicate picture entries

2. Intelligent picture addition
-If it finds a picture who's description is already in the DB, it will check to see if the DB entry still exists, if not, it assumes the file was moved, and simply changes the category for that picture
-This means if you move folders and run this script, all your files will be added
-Thumbs will not be added to the picture list (Note: Filenames containing the thumb suffix that are not thumbs will also be ignored)

3. Detailed logging
-Tells you everything it did or didn't do

NOTES:
This script will be slow, as it does a LOT of sql lookups
This is not error-proof, it could end up with moved pictures showing up as linked to the wrong copy of similarly named files, so search info/comments get put on the wrong pic, but hey, it's a good attempt.

PLEASE PLEASE PLEASE back up your database before running this script so that you make sure it doesn't break your pretty site, I don't take responsibility for anything it breaks.

Let me know what you think!


Edit: Had a typo on order of checking.....check out the newer version as of 7:50am

This post has been edited by Usher: Apr 20 2008, 02:47 PM
Attached File(s)
Attached File  automatic_file_structure_detector.php ( 13.83K ) Number of downloads: 77
 


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
usr.c
post Apr 20 2008, 02:45 PM
Post #10


Boss, my code's compiling (xkcd)
Group Icon

Group: Admins
Posts: 10,440
Joined: 19-September 01
Member No.: 1

Nothing Selected




Great, thanks a lot. original.gif


--------------------


Things that I don't suck at: Photography (flickr, JPG Mag), Skydiving, Splitting atoms, Flying a space shuttle
"Don't bail; the best gold is at the bottom of barrels of crap!" -Randy Pausch
I have people-skills goddamnit! What is wrong with you people!!! | www.skyrill.com
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th May 2013 - 12:38 AM