From 8fb446960c12d147950430712ac099d3c5a0c5e0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 22 May 2014 19:39:25 +0200 Subject: [PATCH] U4-4927 Image Cropper Crop URL is wrong in 6.2.0 Reverts part of 067268a96e472a888aeeae10762b0967b4127a99 which was refactored wrong --- .../imagecropper/ImageInfo.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/umbraco.editorControls/imagecropper/ImageInfo.cs b/src/umbraco.editorControls/imagecropper/ImageInfo.cs index b2fe94365e..addd629880 100644 --- a/src/umbraco.editorControls/imagecropper/ImageInfo.cs +++ b/src/umbraco.editorControls/imagecropper/ImageInfo.cs @@ -32,9 +32,12 @@ namespace umbraco.editorControls.imagecropper //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); + + var fileName = _fs.GetFileName(Path); + Name = fileName.Substring(0, fileName.LastIndexOf('.')); + DateStamp = _fs.GetLastModified(Path).Date; Width = image.Width; Height = image.Height; @@ -74,12 +77,10 @@ namespace umbraco.editorControls.imagecropper { crop = preset.Fit(this); } - - var tmpName = Name.Substring(0, Name.LastIndexOf('.')); - + ImageTransform.Execute( Path, - String.Format("{0}_{1}", tmpName, preset.Name), + String.Format("{0}_{1}", Name, preset.Name), crop.X, crop.Y, crop.X2 - crop.X,