singapore: the smallest big galery
home » forum » Mods » Move _thumbs out of galleries

You are not logged in.

  • Index
  •  » Mods
  •  » Move _thumbs out of galleries

#1 2011-07-03 05:38:47

mikeatx
Member

Move _thumbs out of galleries

I'm hosting my sgal install on my home firewall/fileserver/webserver...

I would like to make galleries a symlink to my photos directory and have sgal generate all it's thumbs in /var/www/mhaertel.com/thumbs.

I have a few reasons for this. My web ready photos archive contains about 18k full resolution photos with only some jpeg compression and my /var partition is only 3GBs, mostly unused at this point.  If something went wrong with the thumb cache, deleting it and running the tools script to recreate everything would be a snap. I'd also have a better idea of where my disk usage is going. I can du -h in the thumbs directory or in my gallery directory and decide if I want to further compress the full resolution photos or just compress the thumbs to performance tune the entire gallery. I also really don't want my photos to be writeable by anything if can be avoided. Finally, I plan to add browser detection and a separate mobile site that indexes the same photo folder and those _thumb subfolders would be problematic.

I'm running Debian 6 (Squeeze) with PHP 5.3.3-7+squeeze3 and sgal 0.10.1

Currently my Gallery is a work in progress with only about a gig of photos in it. http://mhaertel.com if you want to take a look. The only mod I've made so far is the exif addition.

I saw a code change for PHP4 posted a few years ago, but didn't want to attempt it since I could potentially just make a mess on my filesystem if it doesn't still apply.

Also, unrelated, I keep seeing recommendations to chmod to 777. So far I have been fine with things at 755. Running at 777 is simply a bad idea. It makes everything on your site world writable, so anybody with half a brain could modify your site's code, overwrite your photos and most likely compromise your web server in some way. Just make sure your apache user/group owns the files with chown and chmod to 755 should allow everything to work if it's written properly.

Last edited by mikeatx (2011-07-03 06:22:08)

Offline

 

#2 2011-07-05 07:20:25

mikeatx
Member

Re: Move _thumbs out of galleries

Maybe this will help a bit...

I found this from 2007, when .10 was released I'm guessing.

http://www.sgal.org/forum/viewtopic.php?id=2058

I don't understand this portion, could somebody provide an example using the 0.10.1 code?

djmitchella wrote:

If you have PHP5, just change the existing code to pass true as the final argument to the mkdir call, as php5 has recursive mkdir

Will their solution work for 0.10.1?

Last edited by mikeatx (2011-07-05 07:20:50)

Offline

 
  • Index
  •  » Mods
  •  » Move _thumbs out of galleries