Tag Archives: PHP

Finally a Gallery2 WordPress Gallery Replacement

So I’ve got around to testing a large amount of possible replacements for Gallery2 and found one which generally fits (and I hope will be improved since it is entirely stable, but lacking a few features). The need was to have:

  • A WordPress-integrated browsable gallery (so it cannot just be the “attach images to WordPress posts” WordPress uses by default). This would include the ability to have subgalleries and automatic thumbnail creation.
  • The ability to put a gallery image in a post (with caption),
  • Easy to upload images too (ie; would allow multiple file uploads at once. By Java, FTP, Flash, zip etc.).
  • Ability to add some kind of description or name to the pictures.

It also cannot be a off-site host. I frankly despise putting too much on Facebook, while I actually like some of Flickr’s parts too, I have a website for a reason and both want to use it, and not give my photos intentionally to a third party. Faster too to link to my own photos 🙂 and no reliability problems.

Gallery2 Woes

Why get rid of Gallery 2 then? Well, Gallery2 itself isn’t too bad, as it goes (and is easily hackable with plugins, theme changes if you need it to be better) – it had also a great Java upload thing just to process a ton of uploads over HTTP, and resizing (and cropping), thumbnail and subfolder options (such as what was the folder thumbnail) were good too. Naming and descriptions were fine as well.

However, WordPress integration was always problematic. The rarely-updated and complex WPG2 likes things done in a very specific way, often messing up both its own settings and the main Gallery2 install settings (permalinks mainly). It liked its own gallery page, which simply embeds the Gallery2 page bizarrely – I couldn’t get it to work much better, so the Gallery2 part was always off by itself! The actual insertion of images in posts generally worked okay too – a little annoyance at adding odd CSS and HTML but in generally a-okay for what I needed, and finding images worked fine too.

This was a few years ago mind – some of the plugins below didn’t even exist then, and WordPress hadn’t even integrated things like auto-site-updates and its own media offerings were lackluster (and for me still are not suitable, see below). It worked with some effort before. Just I need a better and simply a more simple solution now.

Testing Options

So, in any case I’ll go through what I generally tested then! Some are rather popular ones I just couldn’t get working or were not suitable, cest la vie 🙂 In fact, there were no many that even fitted the “Don’t use the WordPress media upload system”.

WordPress Itself

Hopeless for the above criteria. I need accessible galleries, thumbnails and captions, while WordPress can deal with per-post images, it doesn’t have any captioning options, gallery options (although some plugins hook into it) and organisational options are limited to “by date and post” or “all in one folder”. With hundreds of photos to add at minimum this was unworkable.

Sad, too, since the upload interface allowed easy additions of titles and descriptions when uploading.

NextGEN Gallery

NextGEN was the most popular one I tested. It worked, nicer integration then many, but fails at the “subgalleries”. Some parts were utterly terrible to use – the way you have to make subgalleries and so forth simply failed for me – strange admin interfaces to get it to work, where it simply didn’t want to cooperate. The documentation was poor too, surprisingly. Finally, the upload interface didn’t work with any SSL options enabled, it simply didn’t (neither Admin SSL or what I generally use, forced WordPress SSL worked), which is required for me.

If you want a gallery, try it – but be aware of the issues with subfolders and pictures in those same folders.

Awsom PixGallery

Pixgallery was a nice and simple gallery, might be suitable for others (especially, it appears, comic sites). However, it didn’t work too well for me because of the lack of inline-post-thumbnail options – it works fine as a gallery, but not for having images in posts separately. However it did most other things fine – and has some options I miss in the one I chose, namely things like “Remove underscores and replace with spaces in filenames” and filenames being different from captions/descriptions.

One other oddity with this was nice permalinks were destined to never be added, for no foreseeable reason. Odd, since I rather like them, keeps URL’s nice and readable, which is the point (and is why my site isn’t all p=1412 or something!). Another thing was that ordering could not ever be done with “Folders come first”, which is a bizarre omission and makes ordering things a bit difficult unless you manually order everything.

Coppermine

Sadly, despite Coppermine looking like a competent 3rd party gallery, the only plugins allowed integrated galleries, nothing that helped linked thumbnails and captions into posts easily. This just made me miss this one out entirely, a latecomer in any case, sadly no one is dedicated to do a fuller implementation it seems.

Others…

Not many others played well with my subfolder-madeup WordPress, and wanting to have a page or folder in the root directory. Many were out of date, basically not working with the latest WordPress code (and WordPress.org REALLY needs to add a Mozilla-addons-like “Select the version of WordPress you are on”!). A fair few just integrated other gallery software – mainly external sites (Flickr, Picasa etc.), and others just messed with adding javascript or options over the WordPress upload system.

The Final Choice

Lazyest Gallery

Lazyest Gallery was my choice for a swap. It has it’s own simple system to check a set directory for picture files (so FTP uploads work fine), and create thumbnails and cut down sized versions on the fly – done nicely in the folders themselves. Can caption images relatively easily, and users can comment per picture too. None of the captions are DB based, but instead XML based (comments are just in WP’s normal system). Simple to setup, and some simple options for how the galleries should be displayed (size, columns, amount of things per page, slideshow options and so forth).

The way you put a page up for it is dead easy, and it works with WordPress being in a subfolder thankfully, keeping my site structure neat. It also has excellent syntax for adding whatever kind of image in a post – whatever size, position and caption.

Still not feature-complete enough in some areas – permalinks are on the upcoming features list (yes!), there is little ease of use moving things around (see below for why), and I’d also like at some point separate “Name” and “Caption” fields, which would really solve file naming issues. It also doesn’t have a nice way to find an image to add to posts (the button helps but first you need the image path and name), but this is minor since it is easily copied from the gallery itself. It appears it will continue to be updated with some nice bits and pieces I could use too (such as multiple HTTP upload facilities).

Odd Apache Note

Apache running PHP has any files created by it set to the user “nobody nobody”. With the security risks involved, yes, this means I can’t physically remove some files or folders (arbitrarily sometimes) except through the same PHP scripts (and sometimes it’s just bizarre what does and doesn’t work mind you). Lazyest has problems deleting thumbnails/caches and their folders sometimes, but it can delete the photos themselves it seems from whatever source they were from. I’ve got some simple scripts so if I need to I can force things to be permission 777, then deleted by PHP itself, which should solve any major issues with this. Or I just won’t move much. As long as it is readable so it can be backed up, all should be okay.

Conclusion

There is no perfect WordPress gallery out there yet for me, mainly! I think Lazyest is by far the closest and most well integrated for my needs. I’m going to spend some time moving images over to it (along with their descriptions) and updating the hundreds of posts I have linking to Gallery2 images and replacing them before I remove Gallery entirely. Here’s to hoping it works okay in the end! (And if a better gallery plugin becomes available, I don’t know even then if I’ll bother to swap back, but Lazyest keeps everything quite neat if I ever did 🙂 thumbs up from me on that).