From ded82611a7c328c64ed7707e3b5c9c8802dba7a4 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 19 Mar 2014 15:09:50 +1100 Subject: [PATCH] Finalizes: U4-4472 Image cropper should use IFileSystem - currently uses standard IO --- .../imagecropper/ImageInfo.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/umbraco.editorControls/imagecropper/ImageInfo.cs b/src/umbraco.editorControls/imagecropper/ImageInfo.cs index b02d63256c..b2fe94365e 100644 --- a/src/umbraco.editorControls/imagecropper/ImageInfo.cs +++ b/src/umbraco.editorControls/imagecropper/ImageInfo.cs @@ -28,14 +28,10 @@ namespace umbraco.editorControls.imagecropper try { - if (relativePath.Contains("//")) - { - Path = _fs.GetFullPath(relativePath); - } - else - { - Path = IOHelper.MapPath(relativePath); - } + RelativePath = relativePath; + + //This get's the IFileSystem's path based on the URL (i.e. /media/blah/blah.jpg ) + Path = _fs.GetRelativePath(relativePath); image = Image.FromStream(_fs.OpenFile(Path)); Name = _fs.GetFileName(Path); @@ -43,8 +39,7 @@ namespace umbraco.editorControls.imagecropper Width = image.Width; Height = image.Height; Aspect = (float)Width / Height; - - RelativePath = relativePath; + } catch (Exception) {