The Sueetie Wall supported images for only a couple of weeks, but it’s never too soon to re-engineer something for the Greater Good of Sueetie Nation. To explain why I felt this was a necessary move, let me describe how image handling was initially designed.
Images were stored in 3 sizes to support thumbnail, medium and large display. File format was [ImageID].[SIZE].JPG. This made display super speedy, which was the main reason it was chosen. Images could be displayed with a straight url pull. No fancy file byte extractions and memory stream processing, just a <SRC URL="/images/wall/…/1.small.jpg" /> or <SRC URL="/images/wall/…/1.large.jpg" /> depending on the context.
Speed is king, but we needed more than what a straight URL pull could offer. For one, we needed more security as the Wall moves into other environments like Secure Sueetie Groups. This meant we wanted to verify the user had access to the image. We also needed a more sophisticated filename storage logic. Anyone with a little knowledge of Sueetie’s design could have stepped through the images in a secure wall with http://site/wall/…/1.large.jpg, http://site/wall/…/2.large.jpg, etc.
So we sacrificed a little raw speed for a new Sueetie Wall Image HttpHandler to address the initial design shortcomings. The new WallImageHandler.ashx performs access validation, logs view counts, and intelligent resizing. "Resizing of what," you ask? Rather than storing 3 images for speed’s sake, a single image file is stored in the format #########.EXT.IMAGE where "########" is a unique Guid excerpt and "EXT" is the image file’s extension. The size of the image stored is based on the Wall’s Large Image Size, by default 800×600 pixels, the size the image is displayed in the Lightbox. Images are resized only if they exceed the large size default.
While I was at it, I improved Image handling by saving images in their original format. Initially all images were stored in ImageFormat of JPEG. This sometimes did a number on the quality of PNG-formatted screenshots. Here’s a Wall Message that’s a good example of the improved quality of screenshot PNGs. The PNG Lightbox display will tell the tale.
Can’t leave without a screenshot. Here is a sample Wall storage folder by UserID and WallID listing both images and attachments.