views:

23

answers:

2

I have a site that has a profile page and I would like to allow the users to upload an image for the profile picture. I forsee a problem if the user select an image that is larger than what I am allowing for the site. Is their a good refrence or example how to accomplish this?

The site is developed in Visual Studio 2008 with VB.NET 3.5.

+1  A: 

The following site contains a good example of how to do this - Hybrid ASP.NET File Upload and Resize Sample (VB.NET).

Bermo
I just noticed that you've provided a *PictureBox* tag but at the beginning you refer to a site ... Does that mean you're using a Rich Client or ASP.NET? If it is the former, the image resizing code should still be of value.
Bermo
+1  A: 

If the image is the right shape but just too large you can use the method that Bermo talks about.

However if you'd like to choose the most interesting part of the image you can use the technique that Reddit uses for it's thumbnails.

See here for some info and the source code (Python) is here. Basically it splits the image up into sections and works out which ones are the most interesting by using the entropy value.

Matt Warren