Finalizes: U4-4472 Image cropper should use IFileSystem - currently uses standard IO

This commit is contained in:
Shannon
2014-03-19 15:09:50 +11:00
parent 6a8cb5e123
commit ded82611a7

View File

@@ -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)
{