MiXX.PostIcon released to the public

11 December 2006

EDIT 6/05/2007: Changed links to CS 3.0 version.  Subscribe to here for updates: http://eduncan911.com/archive/tags/The+MiXX+Collection/default.aspx

 

Some of you might have noticed my new homepage over the last month.  Those of you using an RSS reader to read this, go check out my homepage for the new PostIcon module I'm talking about.

What is it?
The purpose of this Server Control and CSModule is to automatically
create a small lightweight PostIcon with little to no work on your part.
Just embed a normal image, bam, you have a PostIcon automatically.

This module creates the PostIcon for a Weblog Post during its creation
and/or update physically on disk. It will connect to your image source,
load into memory, crop, resize, compress, and save the tiny ~2 KB file
to disk. It then adds the full pathname to an ExtendedAttribute for that
post called "PostIcon", allowing for the skin to render where required.
This storage-to-disk method greatly speeds up the homepage rendering as
we do not access the photo gallery.

To use, simply create a blog post with at least one <img> embedded. 
That's it.  The default logic above will take the first <img> in your
post and process it to disk.

Optionally, you can specify a particular image to use as your PostIcon.
Say if you had multple embedded <img>s, or if you don't have an image at
all but wanted a PostIcon for the post.

You can use the BBCode format of:

 [PostIcon Anchor = "Center"]http://domain.com/image.gif[/PostIcon]

This will allow you to specify an Anchor position, if you want to crop
in a certain region.  The Anchor attribute is optional.  See the
module's config file for more information on Anchor.

How does it work?
There are two parts to make this work.  The backend uses the PostIconModule to download into memory, crop, resize, compress, and save the selected image to disk.

And the frontend UI uses the PostIcon server control to rendered the saved image, with smart logic.

What is the logic to determine what gets downloaded, cropped, and saved or even displayed if none is set?
There are two methods of logic.  The first is which image, if any at all, is processed on the initial PostCreation process.  And the other logic is in the PostIcon server control that renders, if there is no image saved from the module.

The PostIconModule determines what url gets written to the post, if any.  It does this by following the order below:

  1. Does the [PostIcon] BBCode exist? If so, parse the image specified.
  2. Is there an <img> declaration somewhere in the post?  If so, parse the first <img> and use it as the PostIcon.

If the PostIconModule fails to parse the image, no url is written.  In which case, the PostIcon server control determines what gets displayed with the logic below:

  1. Is there a DefaultImageUrl specified?  If so, link directly to it.
  2. Is the UseAnonymousAvatar set to true?  If so, link directly to it.

Why are you saving to disk and writing a direct url?  Isn't the Photo Gallery built for that?
Yes, it is but  I wanted speed on my homepage.  And loading the Weblog posts + 20 to 50 images on the homepage is a bit more processing then I care for.

So with the PostIconModule I load the image into a MemoryStream, crop the image based on the Anchor set, resize the image to what is specified in the config, compress it as a JPG (tests showed 60% quality compared to Gif 89a and PNG is smaller then all), and finally save it to disk. 

The PostIcon server control loads only the direct Url that is stored for the post, therefore generating a very quick homepage load time.

Where's the source code?
With the rest of the files below.

Where do I get this wonderful tool?
Here ya go:

(install only)
http://eduncan911.com/files/folders/2611/download.aspx

(source code-must compile)
http://eduncan911.com/files/folders/5894/download.aspx

 

Future Releases
If by popular demand, I might add in rendering of the User's Avatar if multiple people are posting to a single blog.  But since this is rare, I skipped it for now.

Also if by popular demand, I may add in some type of Email detection (i.e. MetaBlog API posts) and display a custom image (if the image logic fails to save one).  For example, I might want to display a common PostIcon for all posts made by Blogmailr.  Such as this one:

 
Reader's Comments
 
Prog said:
11 December 06 2:47 AM

Some of you might have noticed my new homepage over the last month. Those of you using an RSS reader

 
 
Serguei said:
12 December 06 5:12 AM

Thanks for your module. I followed all steps to install it in readme.txt but getting a parser error: "Description: An error occurred during the parsing of a resource required to service this request.

Parser Error Message: Unknown server tag 'MiXX:PostIcon'."

Can you point out how to make it work, please?

Thanks.

 
12 December 06 12:00 PM

Ah, yeah I left that out of the readme.txt file.  Sorry about that.  Hence the Beta release.  ;)

Register the server control's tag prefix by adding this to the top of your skin(s) file you are using it on:

<%@ Register TagPrefix="MiXX" Namespace="MiXX.Controls" Assembly="MiXX" %>

 
12 December 06 5:18 PM

It's about time The Eric released this CSModule! Eric Duncan starting using his MiXX.PostIcon module

 
15 December 06 5:18 PM

news of the day a grab bag for what's happening in Community Server Telligent's Adonis Bitar with a great

 
16 December 06 3:51 PM

Some of you might have noticed my new homepage over the last month. Those of you using an RSS reader

 
16 December 06 4:42 PM

You can download The MiXX Collection here that includes the updated PostIcon AddOn. Change Log =======================

 
18 December 06 8:54 AM

This week... Eric Duncan releases his MiXX.PostIcon module, shown on his eduncan911.com home page. MiXX.PostIcon

 
21 December 06 4:28 PM

If you're reading this post from my site rather than through RSS and you happened to come via the home

 
Dan Bartels said:
09 January 07 1:12 PM

I recently had the pleasure of building out a CS site for the Windows Ultimate team. Its a place where

 
Dave Burke said:
18 January 07 10:36 AM

blog bits Sandbox.netFx3.com. A Community Server site for exploring .NET 3.0 and CardSpace in action.

 
18 January 07 4:29 PM

Windows Vista Ultimate. A new Community Server-driven site. I don't get the "Experience life outside

 
19 January 07 6:50 PM

This week... Eric Duncan releases his MiXX.PostIcon module, shown on his eduncan911.com home page. MiXX.PostIcon

 
20 February 07 6:04 AM

Your MiXX PostIcon download on Community Server seems to be corrupt: http://eduncan911.com/files/folders/communityserver/entry2611.aspx

Would you re-post so we can evaluate. Looks like a cool module...

 
20 February 07 12:20 PM

I see that.  I tried for a while this morning, but the FileGallery seems to be corrupting my upload no mater how I upload it (file storage, data storage, both, direct linking, etc).

For now, I've uploaded a manual copy to the link below, and went back and updated all old posts.

http://eduncan911.com/Downloads/MiXXCollection-Beta2.zip

 
23 February 07 4:06 AM

Downloaded from new link, PostIcon works great!

 
12 March 07 1:12 AM

Windows Vista Ultimate. A new Community Server-driven site. I don't get the "Experience life outside

 
12 March 07 7:56 AM

It's about time The Eric released this CSModule! Eric Duncan starting using his MiXX.PostIcon module

 
JonGWS said:
02 May 07 11:12 AM

How would this work in relation to cs 2007? how can I implement it?

 
02 May 07 11:51 AM

Hello Jon:

It "almost" works with CS2007.  I have it on my agenda to update it this month to work with CS2k7.

If you like, go ahead and subscribe to my RSS feed - as I will post an announcement when it's updated.

 
JonGWS said:
10 May 07 12:29 PM

Hey Eric,

Is this anywhere near completion? I've got a customer breathing down my neck to have this functionality working and I kinda need to give him a date. I'm not trying to push you tho, coz then you'll hate me and stop! lol (",)

 
 
dAMON said:
13 February 09 5:42 AM

Any chance this package could work on CS 2008.5 SP1 without too much work?

 
15 February 09 10:24 AM

@dAMON: I am unaware as the last known verison it worked with was CS 2007.  This is why I supply the source code to modify as you need.

If you would like me to modify it, feel free to drop me a note at eric at eduncan911.com.  

Leave a Comment
Comment Policy: HTML is not allowed. Links and line breaks are converted automatically.
(required) 
(optional)
(required) 

 


  
Enter the anti-spam code you see above (required)

 

Comment Notifications
Subscribe to this post's comments using RSS

If you would like to receive an email when updates are made to this post, please register here