I m trying to create thumbnail image of uploaded image
{
image = new byte\[len\];
updFIle.PostedFile.InputStream.Read(image, 0, len);
ImageUtility objImage = new ImageUtility();
timage = objImage.UpdateGalleryphoto(filemime, len, image, 100, 100);
filename = updFIle.FileName;
BL.clsAdmin obj = new BL.clsAdmin();
//DataTable dt = obj.uploadImage(Request.QueryString\["prop"\].ToString(), image, timage, txtCaption.Text, filename, filemime);
} updateGallery photo is function which generates the thumbnail
public byte[] UpdateGalleryphoto(String strImageType, int len, byte[] thumbnail, int height,int width)
{
byte[] Thumbpic = null;
try
{
int EH = 75; // Max height of thumbnail
int EW = 100;//= 100; // Max width of thumbnail
Thumbpic = new byte[len];
MemoryStream stream = new MemoryStream(thumbnail);
Bitmap bmp = (Bitmap)System.Drawing.Image.FromStream(stream);
int w = bmp.Width;
int h = bmp.Height;
bool bImage = false;
// Adjust hegith or width on basic of width or height whichever is greater on same ratio
if (height >= h && width >= w)
{
return thumbnail;
}
if (h >height)
{
EW = (EH \* w) / h;
}
else
{
EH = (EW \* h) / w;
}
Thumbpic = ModifyImage(thumbnail, EW, EH, strImageType, bImage);
}
catch (Exception ex)
{
throw ex;
}
return Thumbpic;
}
above code is working in 2005 but throwing exception in 2008 at line
Bitmap bmp = (Bitmap)System.Drawing.Image.FromStream(stream);