external_album_folder not working 1.1.5?

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

Comments

  • trisweb Administrator
    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!
  • pdm Member
    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,
  • 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.
  • trisweb Administrator
    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.
Sign In or Register to comment.