G1-G2 Comparison - Gallery Codex
Personal tools

G1-G2 Comparison

From Gallery Codex

Celebrity Death Match: Gallery 1 vs. Gallery 2

Introduction

Currently, this article is being tweaked for the up-coming release of G2.2. Previously, it was edited to include features added in G2.1 and of course the original G2.0 release. G2.2 adds a few neat features, one of the most awsome I think will prove to be the "downloadable plugins" feature. It will let you download *new* plugins right from inside G2, instead of fooling around with FTP or what ever.
Due to the co-existance of Gallery 1 & 2, you might have some questions about the whole thing. This article compares these two products, highlighting their differences, similarities, advantages and disadvantages. It should help you decide which one is better for you, both by offering suggestions and making sure you know as much as possible before choosing. The best place to start is with a brief overview of both products, so you will know the very basics before taking the big plunge.
Gallery 1 and 2 are both web based photo album software, written in PHP. This means that they are meant to reside on a web server, usually in a hosted environment. They use an interface that is entirely web based to make it simpler for you to upload, maintain and show off your images. They both use certain external programs to create thumbnails and custom sized images and they are organized in a hierarchy of folders, with thumbnails of images which when clicked lead to the larger versions of the image. Some of the main features are that it is multi-user, web based, highly automated, flexible and fairly user friendly.

Installation

Installation of both G1 and G2 start with similar steps. You will need to obtain the “code” from the gallery site, extract, and upload it to your site and run a setup wizard. You might need to setup some image manipulation binaries, but there is a chance your hosting provider will already have one which will end up saving you some time. They start to get very different at the setup wizard, G1’s is very complicated and has a lot of options. G2’s is very pretty with as few options as possible to configure, though you will need to give it some database information that G1 does not need.
The release of G2.1 saw a marked improvement in the already great installer. The improvements are primarily visiblity and usability changes, done after a study by OpenUsability.
If you have your own server and are just starting out by installing the very basics (Apache, PHP, MySQL), things can get a little tougher. Most server distributions make installing these applications a snap, but some have minor stumbling points that are simple to fix but not obvious to figure out. MySQL can sometimes be especially painful to get going for a novice.
Which to choose? Since G2 has the simpler and more intuitive installer, I think it would be the first choice. If you like to fill out lots of variables, G1 might be better for you. If you are starting from scratch, G1 has the advantage of *not* requiring MySQL which can sometimes be painful to get working.

Database vs. File Metadata Storage

One of the main differences between Gallery 1 and 2 is how the “metadata” (comments, titles, descriptions, keywords, etc) are kept and maintained. Gallery 1 uses a file based approach whereas Gallery 2 uses a database approach. It might not be obvious, but they both have advantages and disadvantages that are probably the first you will need to take into account when picking. First of all, if your hosting provider doesn’t offer a database option (like MySQL) you have only two options: Use Gallery 1 or find another host.
Storing the metadata in a file is much simpler and thus can be faster for smaller galleries. It also has fewer resource requirements, so will run better on lower end or older servers. Of course, it also has drawbacks. As G1 grows, it will use up more and more memory (ram) to do certain operations. With average usage, G1 starts to top out at around 5,000 images. There are of course sites who host far more than that with ease, and sites that choke much earlier.
Keeping the metadata in a database also has some very real advantages and disadvantages. The biggest advantage is scalability; G2 should be able to keep five, ten, one hundred or even a million images with very little performance difference between them. Of course, other aspects will come into play to determine a realistic maximum but the theoretical limit is big, very big. As proof of this, the care2 connect site is based on a very modified, early alpha version of G2 and hosts over 900,000 images (and probably has 5,000+ users). Being database driven does have a drawback though, if it takes a fairly fixed amount of time to load up the “framework” to deal with the database, smaller galleries may see no advantage or even increased times. A file based system may take 0.1 seconds to open up a 10 image album, but a database system which is fixed at 0.5 seconds for *any* album is still slower for 10 images. Of course, it might take that file based system 10 seconds to load an album with 1,000 images and it would just crash and die trying to load 10,000 images.
Which to choose? If your gallery is going to be large, the obvious choice is G2. If your gallery is going to be small (and stay small) and/or running on very low end hardware, it is a tougher choice. G1 would probably run better for most people, but the flexibility and power of G2 will make most users happier. In this situation, I would suggest trying both and picking the one you like best.


Thumbs, Resized and Full Images

G1 and G2 both support a user definable size for thumbnails, resized images and full images. G2 adds to this by allowing multiple resized images to be specified, which could be very useful for some. Both G1 and G2 also allow you to modify which part of the image is used for the thumbnail, very useful for making a thumb include only what you want. G2 takes this a small step further by also allowing you to upload your own custom image to use as a thumbnail for that specific item. G2 also has a square thumbs module which will automatically make square thumbs (cropped to square aspect ratio or padded to fit in a square). The crop-to-square feature is available as a modification to G1 however, so it is not entirely unique. Both G1 and G2 allow the user to pick a maximum file size or dimension, which helps to limit the amount of space used by images. Both G1 and G2 (from release G2.2) support auto-rotation. If your camera has an orientation sensor or *sometimes* a rotation button you can use on the camera (my Olympus C5050Z has this), G1 and G2 will automatically orient your images correctly.
G1 and G2 both support a fairly wide variety of image formats, but G2 excels here by supporting a few more interesting ones such as PSD, PDF and TIFF. G2 is also able to handle non-image/movie file types much more easily, allowing custom thumbnails for different file types as well as simply allowing them to be uploaded.
Which to choose? As G2 supports more image formats than G1 and (from release G2.2) also supports auto-rotation, it is a fine choice, but G1 is not far behind.

Image Toolkits

Gallery 1 and 2 are both fairly similar in this area, so it will be very brief. They both support using NetPBM and ImageMagick, two very popular open source image manipulation toolkits, for thumbnail and sized image creation. There is also a modification for G1 to allow ffmpeg support. Gallery 2 goes quite a few steps further though, by also supporting GD, dcraw and ffmpeg out of the box. GD is an image manipulation program that can (and usually is) built into PHP, dcraw is able to convert the RAW format images from many digital cameras and perhaps the most exciting is ffmpeg which allows creation of thumbnails for various video formats. Yes, that’s right you can upload a video and have its thumbnail be any frame from within it. Gallery 2 also makes it much easier to support different tools through its module system, allowing for future expansion in a way that is far simpler compared to G1. Another advantage G2 offers is that all of the image toolkits can be active at the same time. This means that GD, IM and NetPBM can all be used at the same time, and in a certain order. In most cases, this allows for a wider variety of supported image formats.
Both G1 and G2 have support for EXIF data, which is important to most digital camera users because it stores detailed information about settings, dates and many other aspects of the image. G2 goes another step further by supporting IPTC, which is another system used for embedding information in an image.
Which to choose? In this respect, G1 doesn't have any advantage over G2. G2 allows those without the ability to execute binaries the option of GD, use of IPTC data, easy video thumbs and images from RAW format.

Permissions System

Gallery 1 and 2 both feature an extensive permissions system. They allow you to choose the owner of albums (giving them full control), who can view an image, who can upload images, who can make comments and many other aspects. Groups are a feature of G2 that makes management of large numbers of users much simpler and easier. Unfortunately, the user interface for permissions in G2 is not very intuitive, though it is very powerful and offers a finer control than G1. This is a known issue and will be worked on at a future date for sure. Both G1 and G2 support "hidden" items which are images or albums that are only visible when the user visits the URL directory or has sufficient permissions to see it. G2 also has password protected albums, which can make it easier to restrict access to images but still also be relativly easy to share.
There is of course one very big difference between G1 and G2 when it comes to permissions. For G1 to work, your directory of images has to be publicly accessible on the internet. This means that anyone can view the image directly, perhaps by guessing the name of a file or by using your site to get an idea of the file and directory names. It can be limited by some means, but it isn’t always possible.
In G2, the directory of images can (and should) be stored outside of your “web root.” This means that if your website is in the directory /domain.com/htdocs/, you can store your G2 images at /domain.com/g2data/ which is impossible to access from the internet. All images are accessed directly through G2’s framework, making the permissions impossible to bypass when the images directory is not web accessible.
Which to choose? If the relativly complex permissions UI of G2 seems daunting, G1 is a good choice. If you want your images to be absolutely protected by your permissions or you manage a large number of users, G2 is the obvious choice. If you don’t mind waiting for a better permissions UI, G2 is the better choice.

Themes

Both Gallery 1 and 2 offer a theme system that allows users to customize the look and feel of their gallery. In G1, it is really limited to colors and to a limited extent, the look. Most G1 themes look fairly similar, differing mainly in color, font and decoration. The general layout remains mostly the same. G2 in contrast is a vastly different beast. It comes with a couple of themes that are all very different from each other, and the potential is literally endless. If you have the time, skills and courage you can make your G2 look like any other photo album system you have ever seen. You can even make it look like one you haven’t seen. This is due to the extreme flexibility of the theme system in G2, which was built from the ground up with themes in mind. There are a couple of themes being developed as part of the Google Summer of Code and a theme contest is planned. At some point, the theme scene will explode.
One of the largest issues with themes and their settings was resolved in the G2.1 release. Now, all theme settings can be recursed so that changes to themes are easy to accomplish. G2.2 supports recursive watermarking, which makes it even better.
Which to choose? There can be only one in this case really: G2’s themes are just so much more attractive and flexible it would be hard to pick G1.

Integration

Both G1 and G2 support some level of integration with a fairly large number of web based software products. It ranges from something as simple as easy linking of images all the way up to sharing users and an indistinguishable layout. There are so many for both that it would take too long to discuss in detail. Instead, if this is your reason for choosing between G1 and G2, it would be best to look into the specific integration you prefer and see how well it is supported. Just some of the popular packages offering G1 or G2 integration are WordPress, phpBB2, Mambo (Joomla), PHPNuke, Invision Board, Drupal, PostNuke and vBulletin. List of all available G2 integrations.
Another important factor for skilled developers is that G2 was written with integration in mind. So if you need to start from scratch, G2 includes an API which allows for user syncing and many other items. G2 can literally become part of whatever you want, instead of just looking like something included in your format.
Which to choose? In this case, I would first check on the status of both G1 and G2’s integration and if this is the main factor in your determination, pick the one with the more advanced integration. Either way, chances are pretty good that the G2 integration for the product you choose will advance fairly quickly to the point you want. If you are a developer and will need to write your integration from scratch, G2 is the way to go.

Uploading

The method for uploading images to G1 and G2 is almost certainly going to be the most important aspect for your gallery’s users. If it is hard to use, ugly, or awkward, people will complain and your family might decide bodily harm is deserved. Luckily, the Wife Acceptance Factor (WAF) is fairly high due to the number of options available for upload.
Both G1 and G2 support an HTML form for uploading where users simply click a browse button, find the file they wish to upload, select it (and up to 10 more) and go. For a few images this is pretty easy, but for more than about 5 it gets tedious. That is why they also offer a Java mini-applet that loads right in the upload page. Uploading is as simple as dragging the images from a file explorer shell to the Java applet and clicking upload. There is also an “Add Pictures” button which will popup the familiar file selection box, but instead of only allowing a single selection it allows multiple. The final upload method with a high WAF is the built in Windows XP upload. On the computer you intend to use, simply download and install the registry file that is offered in your gallery. Now you will have a context based sidebar in XP that will allow you to upload any number of images, right from the shell.
Moving on to the more geek related upload methods, there's a full blown Java-based Gallery Remote (similar to the Java mini applet, but of course much bigger), uploading from a local server and uploading from a URL. The full Java applet Gallery Remote is a standalone application run on a client computer that allows you to interact with your gallery in many ways, including photo upload. Gallery Remote offers drag-and-drop file upload when used with KDE, offering a very attractive option for Linux and *BSD users. Uploading from local server allows you to provide a path on the file system where files will be found, perhaps uploaded with FTP by you earlier. The upload from web page is a very interesting upload method which most people overlook. If you give it the path of an image file, it will download it and add it to your album, but if you give it the path to an html file (or directory), it will parse the html and find all references to images and give you a list to pick and choose from. Very useful! G2's local file upload goes beyond what G1 offers in that you can select a directory for upload, and the entire directory tree will be recreated as an album structure, with all of the files in the directory added, mirroring the structure on disk.
G2 adds one more method that might not be fully considered an upload method, but must be mentioned here for completeness. That is its webcam feature, which allows you to input a URL which will be refreshed at the interval you specify. So if you point it at a webcam, it will download it when ever it should instead of just once. Interesting, but not the full blown webcam system many might hope for.
G2 also adds the ability to upload images directly from certain Nokia camera phones. Of note are also a few modules and tools, such as a Picasa importer and a plug-in for iPhoto (these two are not yet bundled with G2) and the scripts galleryadd.pl and g2add.pl (nearly the same script, but the former is for G1 and the latter for G2) which can be used locally or remotely.
Which to choose? In this case, since G1 and G2 share a base feature set with G2 bringing a few more extras in, I believe the choice is G2. That said, they are both fairly well off and similar, so picking G1 wouldn’t be a mistake either.

Watermarking

For many people, this can be a very important aspect of displaying photos online. Since it is impossible to fully protect an image from being “stolen” if it is visible on the screen, the best way to protect an image is to watermark it. This is something that both G1 and G2 support. G1 and G2 are able to selectively watermark thumbnails, sized images and full images at the user’s choice. G2 again goes a few steps further. With G1, if you watermark the “full” image it is applied directly to the full image and is thus permanent. In G2 watermarks are applied to copies of the image instead, which makes it possible to turn watermarking off, change the watermark in the future and a host of other things. One of those other things is to only watermark images that are hot linked. That means if someone visits your site, all the images will have either no watermark or a watermark of your choosing (perhaps something like “copyright somebody”). If someone then takes the link to your photo and puts it in their own site, the watermark might say “This person is hot linking this picture from domain.com.” A great and perhaps fun solution to hot linking!
G1 and G2 both support watermarking at upload, but only via the HTML form. If you use the java based applet, no watermark is applied. This is easy to fix (in G2 releases from G2.2, and in G1) simply by watermarking the entire album the images are in.
Which to choose? In this case, G2 is better (from release G2.2; previous G2 releases didn't support recursive watermarking). G2 supports such interesting watermarking features, but they can be hard to use (XXX is this still true?). G1's watermarking features are easy to use, but they are limiting and possibly destructive to your original images. If using G1, just don’t watermark your full sized images, so when you migrate, G2 can work with a clean copy of your images.

Voting / Polling / Rating

G1 and G2.1 both support rating in some fashion. The G1 rating is more flexible, allow customization of the choice names and different types of polling / voting. The down side is that G1's rating doesn't look as attractive as G2's. The G2 rating system is very similar to netflix. There are 5 stars and the color of the star is used to display both the average rating *and* your rating. It also includes the number of votes and can *optionally* display the average votes as a small bar. Since it is using images, the look is fairly easily tailored to your own site.
Which to choose? If you need a very elegant and customizable rating system, then G2 has the better offer. If you need rating and polling with user-definable voting options (e.g. text), then only G1 can meet your requirements.

Menu Languages

G1 and G2 both fully support alternate languages in menu and navigation items. G1 has an extensive set of languages available already, fully translated and ready to go. G2 is a little worse off in this regard, with only a few translations fully done, more fairly done and a lot that are mostly not done. There's a complete list of G2 translations. Browse to http://example.com/gallery2/lib/tools/reports/localization.php (available in the devel package of G2) to see the status of the completion of all installed translations. Fortunately, all it takes is someone who speaks both languages and has some time. Maybe you could help?
Which to choose? If you absolutely need your gallery in a language that G2 doesn’t have available yet, you have to choose G1. If you are one of the lucky 4 or 5 languages that are 98% done, G2 would probably be the better choice. If you have the time to actually do the translations, pick G2 and submit them back to the project!

Multi-lingual Albums

One important difference between G1 and G2 is multilingual support in albums. In G1, I have been struggling to balance display aesthetics and the need to let my Chinese audience and English audience both feel comfortable. My solution has been to create really concise titles in both languages and display both on the same page. In G2, you can create a title, a description, and other text info for each language. Users of one language do not see (and be confused by) text info you created for another language.
A subtle difference also leaves a big impact on practicality in multi-lingual support. In G1, default installation includes only English. Each additional language module you add will be shown as an additional option in the language drop box. In G2, default installation includes all available languages (at least for "full installation"), so the drop box is always crowded with more than a dozen choices. There is no obvious method to remove any installed language. So if your gallery is designed to support English and Chinese only, your users will have to scroll really hard to switch to the other supported language - and there is no obvious way for a user to determine which languages do you intend to support.
Assume the gallery's default language is Chinese, a French user will likely select French as the alternate language. Now the user will see that although all menu items becomes French, all titles and descriptions are still in Chinese. If this user also reads English, he or she could have obtained more information by switching to English, but he or she is unlikely to try English under this circumstance. Even worse, this user may have even ventured English (UK) and still find all titles and descriptions in Chinese. He or she would be even more discouraged to try another language so all the information you prepared for English (US) would be wasted.
Another subtle difference affects practicality in multi-lingual support. In G1, one can use an explicit URL to force a language selection. In G2, one cannot. Therefore, in G1, you can announce your gallery or album in different languages with a definitive URL that makes sure the audience sees the URL in the language used in the announcement. You cannot do this in G2.
Which to choose? If you want true multi-lingual support, G2 is definitely superior. However, if you only plan to add album information in a few of the many supported languages, your effort could be buried in the crowded languages drop list. You also lose the ability to announce a convenient URL to audiences of different languages.

Photo Printing Services

G1 and G2 offer the built in ability to send images to an online photo processing facility, but G1 offers more of them. Currently G1 and G2 both offer the services of PhotoAccess, Shutterfly and Fotokasten. Fotokasten offers services in European countries, which could be important for some users. G1 also offers Fotoserve, and adds a service called mPUSH which allows thumbnail images to be sent to cell phones. Fortunately, due to G2’s module system it is much easier to add new services. It is even possible that a service might develop or commission a module for its service to attract new business! Speaking of which, the service "Digibug" developed their own module which is included in G2.2. This is a very interesting module because it *requires* site owners to register with them and allows the site owner to set their own detailed pricing. The latest addition to Gallery 2 printing modules list is SnapGalaxy - they provide local (USA & India) as well as worldwide shipping.
Which to choose? From release G2.2 (and probably G2.1), the number of photo printing services in G1 and G2 are virtual identical. If you take into account the Digibug service for G2 which is extremely flexible, the favor definitely falls to G2.

Hardware

For many people, this will not be a concern due to the fact that they are in a shared hosting environment where they either don't know what their hardware is or have no choice in how powerful it is. Paid shared hosting environments are likely to have much more powerful servers than an individual would have, but they may also tend to be more loaded due to the sheer number of users involved. This is a hard section to write because it can depend on so many variables, but to sum it up before we start: G1 will be more appropriate for "low end" hardware, but of course both will work better as the system increases in power.
The two main aspects of any system are CPU speed and amount of RAM. Generally, since G1 uses a file-based system for metadata, you will need more and more RAM as your gallery and number of images in an album grows. Things in G1 that will increase the amount of RAM needed are the search, stats and block random features. Moving images and albums can also cause high RAM usage, especially when there are lots of sub-albums. This is because it has to build the sub-album list in memory by parsing lots of data files that have to be stored in memory. The only main point when G1 will use CPU is for resizing and building thumbs, but it's likely that you won't really care about this.
G2 should work better in lower RAM environments because the database backend is doing all the grunt work of presenting statistical data, *and* this is what a database is made to do. G2 will benefit more from CPU speed, mainly because the database and abundance of php code will need it. G2 can also build thumbs/sizes on the fly (as well as at upload), so the *initial* load of an album or resized image can take longer as G2 creates the thumb/resized image, so CPU speed will come into play here.
Let's try and apply some numbers, but keep in mind they will be very general and your specific results could vary widely. I would suggest anything below ~800MHz with ~256Mb RAM as "low end", ~800MHz - ~1.5GHz with 512Mb RAM as "middle" and ~1.5GHz+ with 1Gb+ RAM as "high end". These are just rough guesses. The amount of actual traffic will have a pretty big effect on your requirements as you climb into the big time. G1 and G2 should both run on any of these, but G1 will almost certainly have the edge at the low end. At the middle, it will depend a lot on your specific requirements and at the high end you probably won't notice much of a difference between G1 and G2.
Which to choose? If you have a really low end system, you will almost certainly want G1. Installing a php accelerator like eAccelerator can help a lot for any system though. Try both, and if one drastically outperforms the other pick it. Just keep in mind that G2 will scale to a huge number of images and users without requiring much more RAM, but G1 will choke at some point for sure.

Miscellaneous

This section contains some items that are hard to categorize or would yield a very small category. It is mostly features that one or the other does not contain at all which might be of interest.
The main features that G1 has that G2 does not that cannot be categorized are email notification of changes and mirroring. On the G2 side, there are quite a few more. Of major note is the module system that makes G2 so flexible. Pretty much any idea can be developed as a module and then used in G2 with no hard work required, simply unzip the module in the modules directory and turn it on via the web interface. G1 also features RSS feed support and this is not included in the current final release of G2, but it was a Google Summer of Code project that went very well and will be available shortly after release (I have it installed now!).
Some of these unique modules include captcha, maps, quotas, user albums, shopping cart, zip download and random highlights.
  • Captcha is the name for a method of using a distorted image of letters to determine if a user is human or a script of some sort. It can be used during registration, when a user attempts to log in with the wrong password too many times, and to prevent anonymous comment spam.
  • The Maps module extracts the GPS coordinates from your images (if your camera supports this) and shows an interactive (Google) map with the positions where the images have been taken.
  • Quotas allow you to limit the amount of space used by a user, assignable on both a per user basis and a per group basis.
  • User albums are the automatic creation of an album for each user in your gallery, useful for easily adding new users to your gallery if you normally give each user their own album.
  • The “shopping cart” (really just “cart”) module allows users to add images to a standard cart. Instead of just being able to buy images though, the cart can be used to allow images to be sent to one of the printing services or even downloaded as a single zip file.
  • Another of the Google Summer of Code projects is a Zen module that uses the gallery cart. Zen is an open source e-commerce application.
Which to choose? If you need email notification of changes, G1 is probably the choice for you. If you read the paragraph on G2 features and thought to yourself “Wow, some of these are very interesting and useful!” then G2 should be your choice.

Conclusion

As you read this article, you might have noticed a bias toward G2 over G1. I can’t deny it either, because after switching to G2 myself I am a convert. If this article helped you decide, I am glad no matter what. If you read the whole thing and still haven’t decided, I would strongly suggest G2. It has more active developers and really is situated to take over the world, resistance is futile. My name is Locutus and we are the Borg, prepare for assimilation.

Feature Chart

Comparisons by Others

G1, G2, CM & Others Comparison Chart, G2 vs. CM (old)