From 3d4fcdafb8c3d5baf36182bfe8ab8f827514db17 Mon Sep 17 00:00:00 2001 From: DmitriyKulagin Date: Wed, 6 Apr 2022 16:06:32 +0300 Subject: [PATCH] #6161 Fixed a bug that occurred when decoding an image from a stream (FileRoxyFilemanService) --- .../Nop.Services/Media/RoxyFileman/FileRoxyFilemanService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Libraries/Nop.Services/Media/RoxyFileman/FileRoxyFilemanService.cs b/src/Libraries/Nop.Services/Media/RoxyFileman/FileRoxyFilemanService.cs index cb154e1db45..9d15c510b01 100644 --- a/src/Libraries/Nop.Services/Media/RoxyFileman/FileRoxyFilemanService.cs +++ b/src/Libraries/Nop.Services/Media/RoxyFileman/FileRoxyFilemanService.cs @@ -543,7 +543,8 @@ public virtual async Task GetFilesAsync(string directoryPath, string type) if (GetFileType(_fileProvider.GetFileExtension(files[i])) == "image") { await using var stream = new FileStream(physicalPath, FileMode.Open); - var image = SKBitmap.DecodeBounds(stream); + var skData = SKData.Create(stream); + var image = SKBitmap.DecodeBounds(skData); width = image.Width; height = image.Height; }