• Home
  • Flailing Wildly
  • Résumé
  • Design
  • Code
  • Wishlist
  • About Me

Flailing Wildly
Too much straw, not enough camel.

Simple PHP Gallery 1.1

by Ryan Parman • November 19, 2004 • Code, Projects, Website • 4 comments

Paul Griffin has just released SPG 1.1! For those who aren’t familiar with this project, Simple PHP Gallery is exactly that—an easy-to-use image gallery system, written in PHP.

There are several new features listed on Paul’s SPG Mini-Site, but there are a few that are my favorites (as I was a beta tester for this and the last versions):

Image Precaching

This was one of the two features that I actually coded the original code for *grin*. In v1.0 and the early v1.1 betas, I got tired of clicking the Next and Previous buttons and having to wait for the new image to load, after I’d just spent several seconds looking at a single picture. It didn’t seem very efficient to me, so I figured why not allow the image loading to happen in the background while I’m spending time looking at this picture anyways.

So, what I did was I figured out what images the Next and Previous buttons were pointing to (which is all dynamic, BTW), and added the Next and Previous to the page at a size of 1×1. I then added inline styles to the image that absolutely positioned them to the top-left corner of the page, and set the visibility to hidden. Doing so allowed the images to load into the cache, while remaining invisible to CSS-enabled browsers (and as two 1 pixel dots on CSS-disabled browsers).

Voila! Image precaching for the previous and next images in sequence.

Image Resizing

Do you have a digital camera that takes pictures at a ridiculously gargantuan size? I used to have one that saved images at 1600×1200. With this feature, you can upload these images, and they will automatically be resized and cached according to the settings in your sp_config.php file. Very useful.

Accesskey Navigation

This was my first suggestion for features in SPG 1.1 after 1.0 launched. I took a 3ds Max class in college, and we had to build something cool from the things we’d learned in the class, and make both a still frame as well as a short rendered video. Mine was about 3 Macs.

Anyways, I went online to grab various images about the computers that I was going to be building. At first, I’d have to open one, then another, then another. Tiring of this quickly, I wrote up a quick HTML page with a JavaScript that would allow me to simply hit Previous or Next to move from one image to the next. The it dawned on me to use accesskeys, since I knew they at least worked in IE and Mozilla (this was during the pre-Firefox “Phoenix” days).

Instantly, I was able to hit Alt+Plus and Alt+Minus to move back and forth through the images. When I recommended this to Paul, we had some discussion, and this is what ended up getting implemented:

The Previous button is Alt+Minus[-]. The Next button is both Alt+Plus[+] as well as Alt+Equals[=]. This is because most QWERTY-language desktop keyboards have a 10-key number pad on the right where [+] and [-] are right next to each other. Most laptops, however, don’t have that, but rather a [-/_] key right next to a [=/+] key (where you have to press shift for the latter). This means that you’d have to press Alt+Minus to move back, and Alt+Shift+Plus to move forward, and that sucks. Allowing Alt+Equals to move forward makes it easy for both Laptop and Desktop QWERTY-keyboards.

Automatically Generated Sub-Folder Details

This was yet another idea that I had for the 1.1 release, and that was to add the number of images in a folder, much like how many people will display the number of comments a blog post has. It just seemed to make sense.

Conclusion

Paul has done a terrific job with writing this software, and I have really enjoyed the opportunity to be a part of it. Heck, I’m probably just as proud of this release as he is, and I’m excited that so many of my suggestions made it into the final release. If you’ve got an image gallery, or you’ve been thinking of setting one up, I would highly recommend Paul Griffin’s Simple PHP Gallery.

Ryan Parman

Ryan Parman is an entrepreneur, open source evangelist and passionate usability advocate currently living in Seattle. He is the founder and visionary behind SimplePie and CloudFusion, co-founder of WarpShare, member of the RSS Advisory Board, and creator of the AWS SDK for PHP. Ryan's aptly-named blog, Flailing Wildly, is where he writes about ideas longer than 140 characters.

« I Got iBalls… I mean iSight
Our First Christmas Tree »

Discussion

Kevin

November 23, 2004

That is pretty cool, I’m gonna have to give that a try.

 

Ryan Parman

November 23, 2004

Yeah, I should also mention that it’s completely standards-compliant! No tables were harmed or misused in the development of this software…

 

Olly Hodgson

November 24, 2004

Oooh, nice. I already use (a somewhat hacked version of) SPG 1.0. I wonder if I’ll be able to remember all of the changes I made ;o)

 

ted

January 15, 2005

oh no, spg is down!!! any idea where i can get a complete copy of spg? was looking to set that up this week, thanks!

 

Comments for this post are now closed.

Blog search

Archives
  • 2016 (1)
  • 2015 (3)
  • 2014 (6)
  • 2013 (15)
  • 2012 (16)
  • 2011 (27)
  • 2010 (9)
  • 2009 (6)
  • 2008 (12)
  • 2007 (8)
  • 2006 (18)
  • 2005 (57)
  • 2004 (104)
  • 2003 (103)
Categories
  • Apple (62)
  • Browsers (56)
  • Cloud Computing (5)
  • Clueless Recruiters (9)
  • Code (60)
  • Community (2)
  • Creating Websites (32)
  • Culture (8)
  • Design (7)
  • Digital Media (9)
  • Family Life (12)
  • Just for Fun (27)
  • Law (2)
  • Life Lessons (2)
  • Music (5)
  • Notable Quotes (1)
  • Passwords (4)
  • Personal (41)
  • Political (17)
  • Projects (49)
  • Security (6)
  • Software (69)
  • Syndication (28)
  • Technology (92)
  • The Hiring Process (1)
  • Tutorials (9)
  • TV and Movies (17)
  • Video Games (6)
  • Website (62)
  • Work and Business (8)
  • Writing (4)
Socially-aware

Twitter • Facebook • YouTube • Yelp! • Flickr • Instagram • Zerply • LinkedIn • Last.fm • Spotify • Rdio • Pinboard • gdgt

Claim to fame
  • Amazon Web Services
  • WarpShare
  • CloudFusion
  • SimplePie
Legal mumbo-jumbo

All ideas, opinions and comments I post are my own and are in no way affiliated with anybody I work with. If you quote and/or reprint something I've written or said, please direct folks back to this site as a form of attribution. I promise I'll do the same for you. Unless otherwise noted, all content on this site is copyright © 1979–2011 Ryan Parman.

Powered by Rocket Sauce. A Ryan Parman production.