mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
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:
parent
67852e0b76
commit
b600d72156
2 changed files with 31 additions and 17 deletions
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue