Skip to content

Commit

Permalink
Slight performance enhancement.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewEC committed Aug 2, 2017
1 parent 4ebd2af commit e9c30c3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions SteganographyApp.Common/IO/ImageStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,7 @@ public void WriteContentChunkTable(List<int> table)
/// bits required for the content chunk table.</returns>
public bool HasEnoughSpaceForContentChunkTable()
{
using (var image = Image.Load(args.CoverImages[currentImageIndex]))
{
using (var pixels = image.Lock())
{
return (pixels.Width * pixels.Height * 3) > RequiredContentChunkTableBitSize;
}
}
return (currentImageWidth * currentImageHeight * 3) > RequiredContentChunkTableBitSize;
}

/// <summary>
Expand Down

0 comments on commit e9c30c3

Please sign in to comment.