Due to a GDI+ issue with storing PNG images on a non seek able stream, which seems to be fixed with Windows 7, I moved stream-handling specific "fixes" as far "down" as possible. By doing this we should have the best performance and can fix problems easier.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2129 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-10-09 09:17:25 +00:00
commit b600d72156
2 changed files with 31 additions and 17 deletions

View file

@ -415,17 +415,7 @@ namespace GreenshotPlugin.Core {
"image/" + outputSettings.Format.ToString());
formDataStream.Write(Encoding.UTF8.GetBytes(header), 0, Encoding.UTF8.GetByteCount(header));
if (outputSettings.Format == OutputFormat.png) {
// The PNG image formats need to be written to a seekable stream, so we need a intermediate MemoryStream
using (MemoryStream memoryStream = new MemoryStream()) {
ImageOutput.SaveToStream(image, memoryStream, outputSettings);
memoryStream.WriteTo(formDataStream);
}
} else {
ImageOutput.SaveToStream(image, formDataStream, outputSettings);
}
ImageOutput.SaveToStream(image, formDataStream, outputSettings);
}
/// <summary>