mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 21:13:23 -07:00
Fixed uploading issues with PNG, it seems this format can't be written to a network stream (non seekable)
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2127 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
448f82f6c3
commit
da03cf3002
1 changed files with 10 additions and 2 deletions
|
@ -416,8 +416,16 @@ namespace GreenshotPlugin.Core {
|
||||||
|
|
||||||
formDataStream.Write(Encoding.UTF8.GetBytes(header), 0, Encoding.UTF8.GetByteCount(header));
|
formDataStream.Write(Encoding.UTF8.GetBytes(header), 0, Encoding.UTF8.GetByteCount(header));
|
||||||
|
|
||||||
// Write the file data directly to the Stream, rather than serializing it to a string.
|
if (outputSettings.Format == OutputFormat.png) {
|
||||||
ImageOutput.SaveToStream(image, formDataStream, outputSettings);
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue