New Gallery Server Pro Original Image Display Feature Coming

If I had more room in the subject line it would say "New Gallery Server Pro Original Image Display Feature Coming…With a Little Help from Sueetie."  What’s the new image display feature?  Coming in Gummy Bear v1.3 you’ll be able to click on any Gallery Server Pro standard-sized image and view the original image in a new browser tab. You can see it in action in the new Sueetie Administration Screenshots album. Viewing the original image in a new browser tab may not sound very interesting, but it is and here’s why.

Gallery Server Pro can display original images easily, but for efficiency it does it client-side. It works great, but only when the image dimensions fit within the displayable region of the page, typically 1000 pixels wide.  Not a lot of room for images.  This issue isn’t unique to Gallery Server Pro, but it’s why displaying the original image in GSP is an option and disabled at sueetie.com and other GSP sites, including the Gallery Server Pro Demo Photo Gallery at galleryserverpro.com.

Here’s an example of the issue. The original size of this screenshot image is truncated on the right-hand side where it reaches the edge of the displayable web page area. 

I always thought it would be nice if you could click on a Gallery Server Pro image and it would open a new tab automatically with nothing but the original image for me to do with what I wished.  Now in Gummy Bear v1.3 it does and looks like this.

When you hover over an image in Optimized Display the link cursor appears with the help text of "Click to View Original Image."  Here’s what that looks like. Then clicking on the image will display the original image (shown above) in a new tab.

Okay, as David Byrne would say, how did we get here? I can tell you it was with very little modification to Gallery Server Pro source code and only to two class files within the GSP Web Application.

Gallery Server Pro uses an htmlOutput string located in its GalleryServerPro.config to generate the media object HTML. Each media object mimetype has its own htmlOutput string.  It then does a string.Replace() on selected elements based on the MediaObject properties.  Here’s a look at that string in its original format.

Here’s where the Sueetie Framework comes into play. I may want to display original images in another tab at Sueetie.com, but not everyone else might want to.  So I made it optional through a boolean LinkToOriginalImage property in Sueetie.Config.  I also added a custom htmlOutput string in the Sueetie.Config with the hyperlink {OriginalUrl} code we’ll populate from a single new line of code in GSP GalleryPage.cs.

In the GSP Web MediaObjectHtmlBuilder class file we check the Sueetie LinkToOriginalImage property, and if true use the Sueetie.Config HtmlOutput string to populate our MediaObject display HTML instead of the GalleryServerPro.config HtmlOutput string.

I realized an interesting quality about this approach, which is that the custom HtmlOutput string logic could be used to serve up popup windows or other client-side effects. Not only that, but with our SueetieMediaObject which extends the GSP MediaObject type, we can generate completely different display layouts based on the album SueetieMediaType property. That’s for another day.  I have my original image displaying in a new tab, so I’m happy.

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.