Skip to content

Commit

Permalink
DNN-8332 - Avoid file locking when read the no_avatar image
Browse files Browse the repository at this point in the history
  • Loading branch information
francescorivola committed Jan 14, 2016
1 parent 66c80f6 commit c3eefac
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public override Image ProcessImage(Image image)
public Bitmap GetNoAvatarImage()
{
var avatarAbsolutePath = Globals.ApplicationMapPath + @"\images\no_avatar.gif";
using (var stream = new FileStream(avatarAbsolutePath, FileMode.Open))
using (var temp = new Bitmap(avatarAbsolutePath))
{
return new Bitmap(Image.FromStream(stream));
return new Bitmap(temp);
}
}

Expand Down

0 comments on commit c3eefac

Please sign in to comment.