Member
Member
pdm   2008-03-05, 16:54
#1

My Zeninstall works if I leave external_album_folder set to NULL, but I'd really like my photos outside the software directory. I left "album_folder" set to the default "/albums/" and changed external_album_folder to point to a directory writable by the apache user. When I have this set and I upload photos they seem to upload ok, but never show up in the album or gallery, they only show up in the cache. I'm not getting any errors in error_log, it just seems to drop the new albums and images into bit bucket

Specifically the settings I have are:
$conf['album_folder'] = '/albums/';
$conf['external_album_folder'] = '/var/www/data/zenphoto';

And zenphoto is writable.

Thanks,
-pdm

Developer
Developer
trisweb   2008-03-05, 20:56
#2

Is it possible to see your site? Might be able to help better if we can look at the error messages from the image processor. Thanks!

Member
Member
pdm   2008-03-05, 23:14
#3

Well, it turns out you need a trailing slash at the end of the directory there.

$conf['external_album_folder'] = '/var/www/data/zenphoto';

is invalid (it needs to be $conf['external_album_folder'] = '/var/www/data/zenphoto/' , well it works but it is not what you would expect. It creates zenphototest zenphototesting zenphotofoo folders. Added on a trailing / and it works now. Without the trailing slash the images never showed up on the web page though, so one part of the code must be assuming that is a directory path, and another part, not checking for trailing slash is using it as a prefix.

You may want to add a check for that, I think the without slash behavior is unexpected.

Thanks,

Member
Member
jsumners   2008-03-06, 01:40
#4

Actually, a simpler solution would be to never assume a trailing slash. E.g. get_image($conf['external_album_folder'].'/'.$image_name). An extra forward slash should be ignored, thus saving a few cycles for a string compare.

Developer
Developer
trisweb   2008-03-06, 02:15
#5

It's a couple cycles once per load (since it's cached (or at least it is now)), so shouldn't be a big deal, in favor of making the path more correct.

Done and checked in to SVN.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.