11 December 2006
MiXX.PostIcon released to the public

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:

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

# 11 December 06 2:47 AM
Serguei said:

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 5:12 AM

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 12:00 PM

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

# 12 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

# 15 December 06 5:18 PM

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

# 16 December 06 3:51 PM

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

# 16 December 06 4:42 PM

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

# 18 December 06 8:54 AM

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

# 21 December 06 4:28 PM
Dan Bartels said:

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

# 09 January 07 1:12 PM
Dave Burke said:

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

# 18 January 07 10:36 AM

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

# 18 January 07 4:29 PM

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

# 19 January 07 6:50 PM

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 6:04 AM

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

# 20 February 07 12:20 PM

Downloaded from new link, PostIcon works great!

# 23 February 07 4:06 AM

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

# 12 March 07 1:12 AM

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

# 12 March 07 7:56 AM
JonGWS said:

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

# 02 May 07 11:12 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.

# 02 May 07 11:51 AM
JonGWS said:

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 (",)

# 10 May 07 12:29 PM
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