Author Archives: Mark Headrick

Galleries Moved from Gallery to Zenphoto Platform

This change was major enough to warrant its own post. Near the end of June, the Gallery Project announced it was going into “hibernation” with further development being stopped. So, I started looking around for something else. As you can guess from the title of this post, I finally decided on Zenphoto. I had tried Coppermine in the past but I didn’t like it then and it really hasn’t changed since. I also looked at Piwigo, but I didn’t like a few aspects of it. The main one being that its URLs were rather ugly and creating Apache rewrite rules, or internal PHP script handling, would be almost impossible to tell the search bots the new location of my images and pages.

The whole process took me a couple weeks but it involved a lot of behind the scenes work, much of which being specific to my situation so this post will mostly be a summary. Some individual steps could warrant a complete post themselves. Following is a brief (hmm, maybe not LOL) explanation of the steps I took for the switch:

  • Installed Zenphoto locally on my PC to test it out and get familiar with the UI (I have Apache, PHP, and MySQL installed on my PC). Decided on a supplied theme to use as a base (picked Garland) and what plug-ins I needed to do what I wanted.

  • Downloaded the full-size images from my current Gallery at my webhost and placed them into the Zenphoto albums directory. More specifically, I used Putty for shell access on my webhost to create a zip file of each main album and its sub-albums and then used FileZilla to FTP them to my PC and unzipped them. I already had the images locally but I wanted to make sure I was working with the actual files from my Gallery as the file names would prove to be crucial.

  • Created a test sub-domain and database at my webhost for Zenphoto and installed Zenphoto there. Since my webhost has Imagick installed, I changed the graphics option to use it instead. I prefer it over GD as it keeps all the EXiF and IPTC information intact. It was during this time that I uncovered a bug with the image quality setting having no effect with Imagick. Here’s the bug I filed on it and the solution. I changed the code and it’s working fine now.

  • The next phase of the operation is probably what took the longest. Zenphoto is file system based and creates its albums and such from the actual file structure and imports any EXiF and IPTC information it finds to be used as the image’s title, description, original date, tags, and so on. While I technically did not have to do this, I wanted to make sure all my images had the appropriate ExIF and IPTC information stored in them. Some had no information, some just the description and the newer ones had both the title and description (the Gallery software also imports these). Most did have the original (image taken) date in them but some were even missing that. None of the images had IPTC tags stored in them.  We’re talking about 100s of images, over 1,000 in one gallery.

    Initially I used a combination of Exifer, Irfanview, and Exiftool to manually update the images but quickly realized what a pain in the butt it was going to be and the amount of time it would take. Since laziness is the mother of invention, I decided to write a couple PHP scripts to cycle through the images of a specific album, look the images up in the Gallery database to get the image’s title, description, and tags and, using the command line interface of Exiftool, insert that information into the IPTC fields of the actual image (.jpg files). In order for this all to work, the file structure and file names on my PC had to match what was stored in Gallery’s database. I wrote one script to handle the title and description and another script to handle the image tags since those dealt with different parts of the Gallery database. Once I got this to work properly, I made pretty quick work of getting my images set with appropriate ExIF and IPTC information.

  • After getting my images updated, I decided this was the time to create any new albums and/or sub-albums. For example, in my main gallery, I divided up the old single Nature and Astronomy album into Animals and Plants, Astronomy, Mountains, and Weather sub-albums.

  • Created new zip files from the albums on my PC and uploaded them to the webhost in the Zenphoto albums directory. I then used shell access to unzip the files. The Zenphoto software recognized the new albums and images and imported all the ExIF and IPTC metadata from the images into the appropriate database fields. This saved me from having to manually tag the images and so on.  Some parts such as the album names, album descriptions, and image ordering were tweaked at this time.

  • The next process involved creating a set of Apache .htaccess rewrite rules in conjunction with some PHP code to redirect the bots and links that were out there to the new page and image locations. The PHP code was similar to what I had done in the old gallery where it intercepts the gallery’s 404 handling to see if the image actually does exist and, if so, what its new location is and directs the browser there with a 301 redirect. This only works when the image file names remain consistent and are unique. This PHP code also logs what it is looking for (the actual request and my parsed out image portion of the URL) and if it found it or not. If it doesn’t find a match it returns control to the gallery 404 processing. In the case of Zenphoto, I just insert a function call at the beginning of the theme’s 404.php file: if (found_missing_item()) exit; The benefit of this code is that I can also move images around and not worry about creating new rewrite rules.

  • The next step was to flip the switch and point my live gallery sub-domain to the Zenphoto directory and see what happened.

  • The final step was to update the various gallery widgets on my sites to work with the new gallery database and file structure.

Whew!! :) From this point forward I just kept tweaking various parts of the theme, and debugging my PHP code and Apache rewrite rules when I noticed certain things cropping up that I had missed. Like I said earlier, some parts of this could warrant their own post if I really went into the nitty gritty with code examples. If anyone wants to actually know how something was done in more detail, please make a comment. :)

Happy 4th of July for 2014!

Happy Fourth of July!Happy (and safe) 4th of July! :) For those in certain Oklahoma city areas, AAA is offering their Tipsy Tow service for free once again. You can call them at (800) AAA-HELP or (800) 222-4357. So, there’s no excuse for anyone to drink and drive. :)

Here’s a video of my EverQuest II character setting off some fireworks on her outdoor patio a couple years ago. If it were the real world, the house would probably catch fire LOL. Oh, nevermind the snow, it’s always snowing in Frostfang Sea.

Happy Father’s Day 2014

Happy Father's Day

Wishing everyone a Happy Father’s Day weekend, especially mine! Love you Dad! You’re the best! Yeah, I know, I’m recycling the same image I used the last two years but how could I not? After all, his name is also Dale Jr. :) It would be really cool if Dale Jr. happened to win at Michigan tomorrow during Father’s Day. :)

Website Changes for April 2014

First off, the transfer of my websites to the new server went without any problems, for the most part. :) No lost files or data or anything like that, but the FTP server did need some tweaking as it was not allowing standard FTP connections, which caused my Winamp now-playing plug-in to fail as it uses FTP to send the song history list. ImageMagik, which I use with my galleries, also had to be installed (it’s supposed to be on their shared server package). Anyway, since then, the following changes have been made to my websites that are worthy of mention.

Blog

After two more maintenance/security updates to version 3.8, my blog was updated to WordPress v3.9 a couple days ago. As always, backed up the file structure and database before performing the update which went without any problems. I did have to redo my normal tweaks to the code that I do with every update. This post is also a test of the new version’s editor as well.

Mysstie’s EverQuest Website and Gallery

Landmark The Game
For whatever reason, Sony sent me a temporary closed beta key for Landmark (well I did sign-up for EverQuest Next and Landmark beta a few months ago). I decided to install it and check it out. Well, it seems I went ahead and got the Settler’s pack for unlimited access. I figured giving up a pizza would make up for the cost LOL. Anyway, I’ve added a Landmark page to Mysstie’s website and a Landmark Album to Mysstie’s Gallery.


Well, that’s all I can think for now. If anything else comes to mind that I missed or I change/add something before the end of the month, I’ll update this post. :)