BlogEngine.Net Gallery User Control - Version 1.0 Released

February 5, 2008 01:24 by Admin

As promised, here is the first release of the BlogEngine.Net Gallery User Control.

The aim of this User Control is to make it simpler to display a folder of images in a blog post or page. Instead of having to manually insert an image for each image in the directory, simply add a reference to the Gallery User Control, and point it to the Url containing the images. The User Control will then automatically build a table of images and display on the screen.

The first time a Url is scanned for images, a small thumbnail of each image will be created and saved to disk. This may take a few seconds on the first page load, but subsequent load times will be much quicker.

The Gallery User Control makes use of the BlogEngine.Net Lightbox extension (if installed) to provide a nice popup view of the full image.

Full installation and customisation instructions, please check Gallery.ascx.cs in the .zip file

This has all been thrown together rather quickly so apologies for any bugs. 

Please send any feedback/bug reports to me and I will try and correct asap.

Thanks, Paul. 

Gallery1.0.zip (3.18 kb)

Demo: http://www.tumelty.com/blog/post/2005/03/Wedding-Photographs.aspx 

 

UPDATE:

I'm currently working on the next version of the gallery control and hope to add several more features as requested by users.

Over 100 people have currently downloaded the control which is great. If you have any ideas of what you would like to see, let me know and I'll do my best to get it implemented. 


Comments

2/5/2008 3:14:46 AM #

ck

Images are very slow to download (and I'm on a high speed connection), this is because you are using the full iamge to show the thumbnail.  You really have one other option here in .net, and that is to load the image into memory and then spit out the thumbnail sized image to the user.  Puts some work on the server... but that is that fix.  The other option would be to have the user load the images into a writable directory and then kick off a process that creates the thumbnails once... for use all the time.  

Not bad for what it is, but does make the user experience pretty slow.

ck United States

2/5/2008 9:21:10 AM #

ptumelty

Hi CK, apologies for the slow load time. The User Control can operate in one of two modes. By default, thumbnails are created the first time the image is accessed. This can result in a slightly longer load time (depending on how many pictures, and the size of them) for the initial page load. Subsequent page loads will then use the thumbnail images.

What happened here, is that the last test I did before uploading the code was to make sure my GenerateThumbnails parameter was working. When this is set to false, no thumbnails are created and instead, they are done straight from the image files.

Unfortunately, I left the demo page in this mode which is what caused the slowness for you. This mode is really only intended as a fallback for when the users do not have write permissions on the server. I've also updated the size of the generated thumbnail to make sure download times are quicker. Each thumbnail should now be around 15-20kb max. I've updated the demo page to work off the thumbnails.

ptumelty United Kingdom

2/5/2008 1:53:12 PM #

herman

Hi
Very nice job. I was looking for such control for long time now. BE developers simply ignore the request by community to add this feature to Blog but you did it. Thanks
Adding image comments and image rating will make it the best control I have every download.

herman

2/18/2008 4:03:08 PM #

Matt

www.betaparticle.com/post.aspx

Version with autothumbnailing without writing to the server.  I just use an aspx page that takes an img path and then autothumbnails it.

Matt

2/18/2008 4:24:16 PM #

ptumelty

Hi Matt,

There is already a GenerateThumbnails=false property which will supress thumbnails from being created.

Paul.

ptumelty United Kingdom

2/22/2008 6:25:18 PM #

Tim

Hi

Is there an easy way to cope with multiple sets of thumbnails with the lightbox addin on the blog page

they all get combined together as in your ascx file you have "testing" set

so i guess away of having testing1, testing2 etc??

Tim

Tim United Kingdom

2/26/2008 9:45:41 AM #

Pietro

Hi!!excuse my poor english...
You did a very good job!!thanks!
I' have a problem with ImageUrl property:
in the home page everything works fine but in the post detail the control can't find the images.
How i have to write the imageUrl?

Pietro

2/26/2008 9:51:29 AM #

ptumelty

Hi Pietro, all you need to enter is the Base URL of the images. It sounds like you have this right if they are showing on the main screen.

If the images were stored at

http://www.tumelty.com/blog/gallery/1.jpg" rel="nofollow">http://www.tumelty.com/blog/gallery/1.jpg

you would enter

http://www.tumelty.com/blog/gallery/

Send me a link to your page and I'll have a look at the generated html and see if I can work out whats happening.

Paul.

ptumelty United Kingdom

2/26/2008 9:54:03 AM #

ptumelty

Hi Tim,

In the next release of the control (hopefully some time this week time permitting) I will add this as a feature so you can pass the string in to the user control as a parameter.

I'm also adding a new feature which will enable "smarter" resizing of images in one of three different modes. Either by Percentage, To a fixed size with padding, or a cropped resize.

I'll post to the blog as soon as its ready.

ptumelty United Kingdom

3/16/2008 4:11:42 AM #

Dave Morse

So, I download and install this app on my Windows HomeServer site.  Fight with it - path to photos not gelling for me, getting errors and such.  Got frustrated, and uninstalled.

Went to my son's Little League game, watched them lose the first game of the season.

Came home, and couldn't find any other album software I wanted to try, so I reinstalled the app, and messed with the path for a few minutes...

Whoo Hoo!!!! It works like a champ!

Thanks for the great software!  Watch my blog for the upcoming trip to Washington D.C.

Dave Morse

4/7/2008 3:48:16 PM #

JP

Actually, I just took a look at the ascx files and answered some of my own questions. Feel free to erase my lame comments if you want. Thanks again.

JP United States

4/15/2008 3:33:09 PM #

Ben

Any thoughts to adding "Lightbox" extension support?  Maybe even by adding support for René Kuss's "LightBox Extension" extension?

blog.data-worx.de/page/Extension-Lightbox.aspx

Otherwise, excellent work!

Ben United States

4/15/2008 3:37:45 PM #

Ben

Man! I am an idiot.  I completely overlooked your comment about lightbox support.... so scratch the first part of my last comment and add in another "Excellent Job!"

Thanks.

Ben

Ben United States

6/30/2008 7:14:54 AM #

jimmy

I can't this to work at all, i keep getting
ERROR - UNABLE TO LOAD CONTROL : /blog/user controls/gallery.ascx ImageUrl=http://www.blogsite.dk/images;RepeatColumns=6

anyone have an idear

jimmy

7/1/2008 9:11:29 PM #

Joshua

Do you know if storing your photos in the /App_Data/ folder would cause them to be displayed as broken image links? Right now, that's what they're doing. However, looking at the properties of the thumbnails and the links to the images everything is exactly what it's supposed to be.

Joshua United States

7/2/2008 12:47:53 AM #

Joshua

Hello,

I really like the control that you've created and thank you for making it available.

One suggestion that I have is when you create a copy of the image, copy the title of the original image and carry it over to the thumbnail. Then when you display the thumbnails, you can use the title in the HTML and the Lightbox will use it as well when displaying the large version.

Joshua United States

7/12/2008 7:17:23 AM #

Ryan

Is this extension still available, download links seem to be broken.

Ryan United States

9/14/2008 6:19:04 PM #

Bryan Avery

Great extension, well done

Bryan Avery United Kingdom

10/14/2008 9:15:30 PM #

Jeremy

I am using the gallery user control on GoDaddy hosting. Unfortunately, all I ever see is the HTML/control markup in the post. It doesn't generate the table of thumbnails. I've used the control on other sites with no problems--any thoughts? Thanks in advance.

Jeremy

3/2/2009 6:41:29 PM #

MattB

Thanks for a great control. Is it still under development? I also sometimes see the problem mentioned above with only markup appearing instead of the thumbnail gallery (but I am not using a GoDaddy hosting). It seems to help if I can copy/paste a working instance from another post into the new one, run it once, and then go back and edit the path - no idea why.
Comments and rating per pic would be great!
Also being able to integrate it so I have a button in the editor to add a gallery to a post would be nice. I was think I might be able to hack this in myself. Anyone tried it?

MattB United States

3/9/2009 8:56:48 AM #

Why is the [usercontrol:...] code not being parsed when the page loads?

Is there anything in my web.config or what?

Henric

6/13/2009 2:34:53 PM #

Poppers

Thanks for sharing. By the way i cant view the zip file.

Regards
Poppers

Poppers United States

6/28/2009 3:45:16 PM #

neil hanvey

hi paul, any ideas why my control (which is 90% working now Smile ) is not finding the correct path? it's getting everything right except it's adding /post/ into the image url. I'm using be.net latest build if that helps

neil hanvey United Kingdom