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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user