Merge branch 'normalize-stream-seek' of https://github.com/JimBobSquarePants/Umbraco-CMS into JimBobSquarePants-normalize-stream-seek

# Conflicts:
#	src/Umbraco.Core/Media/ImageHelper.cs
This commit is contained in:
Shannon
2017-04-18 13:11:44 +10:00
parent 68fb951283
commit 2dac1b3cf5
3 changed files with 4 additions and 4 deletions

View File

@@ -122,7 +122,7 @@ namespace Umbraco.Core.IO
Directory.CreateDirectory(Path.GetDirectoryName(fullPath)); // ensure it exists
if (stream.CanSeek)
stream.Seek(0, 0);
stream.Seek(0, SeekOrigin.Begin);
using (var destination = (Stream)File.Create(fullPath))
stream.CopyTo(destination);

View File

@@ -238,7 +238,7 @@ namespace Umbraco.Core.Media
using (var ms = new MemoryStream())
{
bp.Save(ms, codec, ep);
ms.Seek(0, 0);
ms.Seek(0, SeekOrigin.Begin);
fs.AddFile(predictableThumbnailName, ms);
fs.AddFile(predictableThumbnailNameJpg, ms);
@@ -249,7 +249,7 @@ namespace Umbraco.Core.Media
using (var ms = new MemoryStream())
{
bp.Save(ms, codec, ep);
ms.Seek(0, 0);
ms.Seek(0, SeekOrigin.Begin);
fs.AddFile(newFileName, ms);
}

View File

@@ -545,7 +545,7 @@ namespace Umbraco.Core.Models
if (supportsResizing)
{
//get the original image from the original stream
if (fileStream.CanSeek) fileStream.Seek(0, 0);
if (fileStream.CanSeek) fileStream.Seek(0, SeekOrigin.Begin);
using (var originalImage = Image.FromStream(fileStream))
{
var additionalSizes = new List<int>();