|  About Me  |  Blogs  |  Photos  |  Publications  |  Resume  | 

ibao’s Gallery2 Theme Release

October 24th, 2006

If you like the theme of our gallery, you can now get it here! But before you begin, here are a few words of warning regarding this release. This is a highly customized theme based on Siriux which wasn’t intended to be published so it is unlikely to “just work” for you. If you don’t mind getting your hands dirty then carry on. My support will be best effort but limited so I hope the users can help each other out.

Here are the instructions (beta). Feedback is appreciated.

Step 1 - Install

Download the ibao theme. Unzip it to the gallery themes directory (e.g. /usr/shared/gallery2/themes/ibao). Go to [Site Admin -> Themes] Install and activate the ibao theme then set ibao as the default theme for the gallery.

Step 2 - Configure

Here are my configurations for [Site Admin -> Themes -> Ibao]:

Number of items to show per page 	= 15
Blocks to show on album pages
- Album quick links (Dropdown)
- Item actions
- Show comments Blocks to show on photo pages
Blocks to show on photo pages
- Item actions
- EXIF/IPTC photo info
- Show comments
Width of page content in pixels 	= This is ignored, the width is set to 80% of the window width in the css.

Step 3 - Patch ImageMagick for panomaras

In order allow panorama thumbnails to stretch out and breath we need to patch the imagemagick module. Modify the following file modules/imagemagick/classes/ImageMagickToolkit.class

Change this:

if ($width > $parameters[0] || $height > $parameters[0]) {
$this->_addResizeParam($transform, $parameters[0]);
list ($width, $height) =   GalleryUtilities::scaleDimensionsToFit($width, $height, $parameters[0]);
}

To this:

if ($width > $parameters[0] || $height > $parameters[0]) {
if ( $width > $height ) { /* fixed height for pan photos*/
$this->_addResizeParam($transform, $parameters[0]*6, $parameters[0]*0.75);
list ($width, $height) =       GalleryUtilities::scaleDimensionsToFit($width, $height, $parameters[0]*6, $parameters[0]*0.75);
}else{
$this->_addResizeParam($transform, $parameters[0]);
list ($width, $height) =      GalleryUtilities::scaleDimensionsToFit($width, $height, $parameters[0]);
}
}

We then tell gallery2 to use the ImageMagick module over other toolkits by moving ImageMagick all the way up in [Site Admin -> Toolkit Priority].

Step 4 - Setting the look for the front page

The ibao theme uses a special look of alternating panoramas for the top page of the gallery. You can select anything from a sub-album as the highlight. I wanted however something that’s not part of the gallery so I manually edited some panoramas to 4×1 ratio and put it in a private album under each top level album. I then select a panorama from each album as the highlight on the top page. I made this album private so that only the administrator can see it.

I set the thumbnail size to 180 for the top album and 200 for the sub albums under [Edit Album -> Album].

You may have noticed that there is a sidebar on the top page. In it is a manual link to the Google Map module which you need to download and install separately. I also added more blocks in [Edit Album -> Theme -> Blocks to show on album pages] the following: Search Box, Image Block, and Shopping Cart Info.

Hidden gems/hacks

  • There is a hidden hack for the album titled “Panoramas”. The theme will use a different style such that the highlights can be shown at full length rather than been shown as cropped if it were in a normal album.
  • If you have entered a summary for an image it will be displayed in the album view though it won’t look particularly pretty.
  • In the last block of ibao/template/theme.tpl there is code for Google Analytics. If you use Analytics uncomment those two lines and insert your account number.

When all else fails, here’s the System Information of my gallery installation:

Gallery version = 2.1.1 core 1.1.0.1
PHP version = 4.3.10-16 apache2handler
Webserver = Apache/2.0.54 (Debian GNU/Linux) mod_auth_pgsql/2.0.2b1 DAV/2 mod_jk2/2.0.4 mod_python/3.1.3 Python/2.3.5 PHP/4.3.10-16 mod_ssl/2.0.54 OpenSSL/0.9.7e
Database = mysqlt 4.0.24_Debian-10sarge2-log, lock.system=flock
Toolkits = Exif, ArchiveUpload, Dcraw, Ffmpeg, NetPBM, Gd, ImageMagick
Acceleration = none, none
Operating system = Linux plum 2.6.12-1-k7 #1 Tue Sep 27 13:22:07 JST 2005 i686
Default theme = ibao
Locale = en_US
Browser = Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.2) Gecko/20060330 Firefox/1.5.0.2

Have fun, good luck and please leave your feedback!

Emerge multisync with evolution2

March 7th, 2006

After I upgraded to Evolution2 the multisync fails to emerge with the following error:

i686-pc-linux-gnu-gcc: @EVO_LDFLAGS@: No such file or directory
i686-pc-linux-gnu-gcc: @EVO_LIBS@: No such file or directory
make[2]: *** [libevolution2_sync.la] Error 1
make[2]: Leaving directory `/var/tmp/portage/multisync-0.83_pre20050414-r3/work/multisync/plugins/evolution2_sync/src’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/multisync-0.83_pre20050414-r3/work/multisync/plugins/evolution2_sync’
make: *** [all] Error 2

!!! ERROR: app-pda/multisync-0.83_pre20050414-r3 failed.

I found tips for the solution in this German thread. Here are the steps to get it compiling:

First you start emerging multisync but suspend it with Control-z right after the source is unpacked, i.e.,

$ emerge multisync
...
unpacked source
ctrl ^z

You then go to where the source is unpacked and modify Makefile.am to take out the EVO flags, i.e.,

$ cd /var/tmp/portage/multisync-0.83_pre20050414-r3/work/multisync/plugins/evolution2_sync/src
$ edit Makefile.am and remove  @EVO_LDFLAGS@ and @EVO_LIBS@ towards the bottom

Continue with the emerge, i.e.,

$ fg

It should then complete gracefully :)

How JSP & JSTL access attributes

February 25th, 2006

Some jsp & jstl equivalence in accessing attributes

<%= pageContext.getAttribute("foo") %> == ${pageScope.foo} or ${foo}
<%= request.getAttribute("bar") %> == ${requestScope.bar}
<%= session.getAttribute("frotz") %> == ${sessionScope.frotz}
<%= application.getAttribute("filfre") %> == ${applicationScope.filfre}

WordPress 2.0 no comment count with SK2

February 14th, 2006

I recently upgraded to WordPress 2.0 with my Life Notes blog and noticed that the comments stopped counting. I found in a wordpress troubleshoot that it may be caused by incompatibility with Spam Karma 2 and indeed after I deactivated SK2 new comments shows up in count. In the trouble shoot it says to fix the count of previous comments you need to upgrade to Spam Karma 2.1 and follow Options -> SpamKarma -> Approved Comments. Select them all, and run them through the WPCompat plugin.

After this experience I decided to try out Akismet which is the default spam filter for Wordpress 2.0. It needs an API key to activate. To obtain the API one needs to sign up at wordpress.com not to be confused with wordpress.org. After you get an account there, log in, go to profiles and you will find a key at the top.

Life Notes going Live! (my new blog)

February 10th, 2006

I opened my new blog Life Notes. This is where I’ll be posting the more non technical stuff.

WPG2 settings for gallery on another vhost

December 20th, 2005

I installed the WordPress Gallery2 plugin for my other blog. The default installation does not quite work for me since my gallery is accessed via a different vhost even though they’re both on the same machine, i.e., http://blog.ibao.net/notes points to /var/www/ibao.net/blog/notes and http://gallery.ibao.net points to /var/www/ibao.net/gallery.

To get around it I specified the “Embedded Path prefix” in the gallery2 plugin options to be “gallery”, so that links to gallery would be in the form of http://blog.ibao.net/gallery/notes/path/under/gallery. I then redirect everything under gallery/notes/ on blog.ibao.net to gallery.ibao.net in the .htaccess file, i.e.,

redirectMatch 301 ^/gallery/notes/(.*) http://gallery.ibao.net/$1

Now it should work.

As a reference here are my full embedded paths configuration:

Relative Gallery2 Path=      ../../gallery/
Embed Gallery2 Page Name=    wp-gallery2.php
Path from web document root= /notes/
Gallery Error Redirect=      http://blog.ibao.net/notes/index.php
Document Root Path=          /var/www/ibao.net/blog
Embedded Path prefix=        gallery