Last post Feb 19, 2009 08:57 PM by someguy198650
Feb 19, 2009 04:28 PM|bcweed966|LINK
I have an app which uploads a picture, sizes it and stores it in the session while it is being displayed and until the user decides to keep it or not.
then it calls another sunction to save the picture that is kept in the session variable but at that point I get an error on my live version.
the error is" A generic GDI error occured"
That error only occurs on my live version, meaning that on my development version in visual studio the error does not happen.
also the eror seem to happen only with cetain file, and not necessarely the big ones.
Why is this happening? below is the code.
this is the procedure that receives the uploaded file, resizes it and stores it in the session:
UpLoadTriggerv = 1
fileExtension = System.IO.Path. _
originalBounds = bitO.GetBounds(pixel)
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality
g.DrawImage(bitO, ResizedImageBounds, originalBounds, GraphicsUnit.Pixel)
g2.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality
g2.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
g2.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality
g2.DrawImage(bitO, thumbnailBounds, originalBounds, GraphicsUnit.Pixel)
errorit = ex.Message
this is the procedure that then takes it from the session to save it to disk:
CurrentPicID = BCWeed.Weedbook.BLL.Albums.Photo.GetNewPhotoID(AlbumID, FrameID)
ProgramedPath = BCWeed.Weedbook.Globals.Settings.albums.PhotoAlbumDirectory
dirPath = Server.MapPath(dirUrl +
fileName = CurrentPicID.ToString + fileExtension
ImFormat = System.Drawing.Imaging.ImageFormat.Jpeg
ImFormat = System.Drawing.Imaging.ImageFormat.Png
ImFormat = System.Drawing.Imaging.ImageFormat.Gif
i.Save(dirPath + fileName, ImFormat)
BCWeed.Weedbook.BLL.Albums.Photo.UpdateNewPhoto(AlbumID, FrameID, CurrentPicID, Title, description, Sdescription, fileName)
dirPath = HttpContext.Current.Server.MapPath(dirUrl +
I tried saving it both ways like that:
and like that
i.Save(dirPath + fileName)
what Am I doing wrong?
Feb 19, 2009 08:57 PM|someguy198650|LINK